天涯梦人 发表于 2013-3-20 21:22:23

请教下如何用GPRS900C向WEB发送htpp post请求,更网站数据

我想用单片机控制GPRS模块连接上网,之后把单片机采集到的数据发到一个网站上去,我用抓包工具得到更新网站数据的http请求,如下
POST /v1.0/device/2182/sensor/2848/datapoints HTTP/1.1
U-ApiKey: f6dff9e05de8ff0d84c115709a478a6a
Content-Type: application/x-www-form-urlencoded
Host: api.yeelink.net
Content-Length: 14

{"value":35.0}

之后我用串口助手,发送AT指令,让GPRS模块与网站建立TCP连接,之后把这http请求发过去,但得到的响应是400错误。
应该是我发送的http请求格式不对,所以请教下如何用GPRS900C想WEB发送http post请求。

devcang 发表于 2013-3-21 00:33:13

注意连接、POST格式、注意回车


~~~~~~~~~~~~~~~~~~~~

duanll 发表于 2013-3-21 09:34:32

你应该用HEX方式通过串口助手发送,否则很容易出错。

qiushui_007 发表于 2013-9-12 14:10:56

把顺序改改:

POST /v1.0/device/2182/sensor/2848/datapoints HTTP/1.1
Host: api.yeelink.net
U-ApiKey: f6dff9e05de8ff0d84c115709a478a6a
Content-Type: application/x-www-form-urlencoded
Content-Length: 14

{"value":35.0}

woshixiaozhou 发表于 2014-1-24 21:56:48

楼主怎么解决的?

czr27 发表于 2014-2-16 00:08:11

我当初用stc516好像是这个型号ram算stc最大的那个移植也只能发很少量数据,尽管网页写在code区发送的时候还是进ram的,我用自定义格式上位机读的
页: [1]
查看完整版本: 请教下如何用GPRS900C向WEB发送htpp post请求,更网站数据