telit 调制解调器使用 AT 命令在 post 上收到 400 个错误请求

telit modem gets 400 bad request on post using AT commands

我似乎无法让 telit (HE910-NAG) 蜂窝调制解调器按照数据 sheet 中的示例执行 http post。我发送的参数是"test=test"。无论我做什么,我都会收到 400 Bad Request。以下是我的命令。一旦获得“>>>”,我将发送 post 参数。获取请求工作正常。

这让我秃顶了。

AT#SGACT=1,1


#SGACT: 33.231.2.193

OK

AT#HTTPCFG=0,"httpbin.org",80,0,,,0,120,1

OK

AT#HTTPSND=0,0,”POST /post HTTP/1.1”,9,0


>>>

OK




#HTTPRING: 0,400,"",0

AT#HTTPRCV=0



<<<
Server: nginx
Date: Tue, 01 Nov 2016 23:15:43 GMT
Content-Type: text/html
Content-Length: 166
Connection: close

<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>


OK

我一直无法让它工作。我最终改为这样做了。尽管它没有那么短,但效果很好。附带一提,我之前试过这个但无法让它工作,因为我在 AT#SD 命令中的地址周围有引号。我有引号是因为这个例子有引号。

AT#SD=1,0,80,httpbin.org

POST /login HTTP/1.1
Host: httpbin.org
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Content-Length: 9

test=test