移远官网

請教關於EG91模快使用AT指令透過HTTP GET取得資訊

下列是使用curl取得HTTP资讯,我想使用AT指令来实现它。
//----------------------------------------------------------------------------------------------------------------------------------------------
curl --request GET
–url https://staging.nordicgamekeeper.com/api/partner/v1/hardware/camera/89332401000017638129/configuration
–header ‘Authorization: Basic a2luZ2hhdDplMnQwbjl0MHkzYjJvNGEwejdtOG80ZjB6M2sxejFiNQ’
–header ‘Accepts: application/json’
//-------------------------------------------------------------------------------------------------------------------------------------------

我所使用的AT指令與執行結果如下:
//-------------------------------------------------------------------------------------------------------------------------------------------
[2021-11-22 13:53:21:545_S:] AT+QHTTPCFG=“contextid” ,1
[2021-11-22 13:53:21:552_R:] AT+QHTTPCFG=“contextid” ,1
[2021-11-22 13:53:21:568_R:] OK
[2021-11-22 13:53:27:548_S:] AT+QHTTPCFG=“responseheader”,1
[2021-11-22 13:53:27:562_R:] AT+QHTTPCFG=“responseheader”,1
[2021-11-22 13:53:27:562_R:] OK
[2021-11-22 13:53:32:469_S:] AT+QHTTPCFG=“requestheader”,1
[2021-11-22 13:53:32:486_R:] AT+QHTTPCFG=“requestheader”,1
[2021-11-22 13:53:32:486_R:] OK
[2021-11-22 13:53:40:310_S:] AT+QHTTPCFG=“sslctxid”,1
[2021-11-22 13:53:40:317_R:] AT+QHTTPCFG=“sslctxid”,1
[2021-11-22 13:53:40:317_R:] OK
[2021-11-22 13:53:45:449_S:] AT+QSSLCFG=“sslversion”,1,3
[2021-11-22 13:53:45:464_R:] AT+QSSLCFG=“sslversion”,1,3
[2021-11-22 13:53:45:464_R:] OK
[2021-11-22 13:54:03:153_S:] AT+QIACT?
[2021-11-22 13:54:03:157_R:] AT+QIACT?
[2021-11-22 13:54:03:173_R:] OK
[2021-11-22 13:54:12:107_S:] AT+QICSGP=1,1,“UNINET”,"" ,"" ,1
[2021-11-22 13:54:12:125_R:] AT+QICSGP=1,1,“UNINET”,"" ,"" ,1
[2021-11-22 13:54:12:125_R:] OK
[2021-11-22 13:54:21:539_S:] AT+QIACT?
[2021-11-22 13:54:21:554_R:] AT+QIACT?
[2021-11-22 13:54:21:554_R:] OK
[2021-11-22 13:54:30:973_S:] AT+QIACT=1
[2021-11-22 13:54:30:986_R:] AT+QIACT=1
[2021-11-22 13:54:31:001_R:] OK
[2021-11-22 13:54:37:949_S:] AT+QIACT?
[2021-11-22 13:54:37:954_R:] AT+QIACT?
[2021-11-22 13:54:37:970_R:] +QIACT: 1,1,1,“100.104.204.136”

[2021-11-22 13:54:37:970_R:] OK
[2021-11-22 13:54:46:487_S:] AT+QSSLCFG=“seclevel”,1,0
[2021-11-22 13:54:46:505_R:] AT+QSSLCFG=“seclevel”,1,0
[2021-11-22 13:54:46:505_R:] OK
[2021-11-22 13:54:51:839_S:] AT+QSSLCFG=“sni”,1,1
[2021-11-22 13:54:51:861_R:] AT+QSSLCFG=“sni”,1,1
[2021-11-22 13:54:51:861_R:] OK
[2021-11-22 13:54:58:636_S:] AT+QHTTPURL=103,80
[2021-11-22 13:54:58:652_R:] AT+QHTTPURL=103,80
[2021-11-22 13:54:58:652_R:] CONNECT
[2021-11-22 13:55:06:279_S:] https://staging.nordicgamekeeper.com/api/partner/v1/hardware/camera/89332401000017638129/configuratio

[2021-11-22 13:55:06:293_R:] OK
[2021-11-22 13:56:54:150_S:] AT+QHTTPGET=80,107,80
[2021-11-22 13:56:54:167_R:] AT+QHTTPGET=80,107,80
[2021-11-22 13:56:55:078_R:] CONNECT
[2021-11-22 13:56:57:314_S:] Authorization: Basic a2luZ2hhdDplMnQwbjl0MHkzYjJvNGEwejdtOG80ZjB6M2sxejFiNQ\r\nAccepts: application/json\r\n\r\n

[2021-11-22 13:56:57:332_R:] OK

[2021-11-22 13:58:17:344_R:] +QHTTPGET: Http timeout
//-------------------------------------------------------------------------------------------------------------------------------------------
不管我怎麼嘗試,最後都出現Http timeout,想請問如何解決這個問題。謝謝!

你好:
你设置的是自定义请求头 ,可以先检查设置的请求头是都正确,然后再继续调试谢谢!

感谢noam回覆,

我确定我的请求头是正确的,是直接复制文章最上面curl指令。

我怀疑是不是我在输入头请求时,哪里不正确?

谢谢!

找到原因了,在输入头需求时,字节算错了,必需把/r/n的字节算进去。