所以我有一个带有CC3000防护罩的arduino uno,我想将数据推送到我的Xively帐户: https://xively.com/develop/yS4XfViIIEEkB94MJ4zs 但是,当我连接时,我收到此错误:
Connected!
Request DHCP
api.xively.com -> 64.94.18.120
Data Lengthz
PUT /v2/feeds/97346308.json HTTP/1.1
Host: api.xively.com
X-ApiKey:mykey
Content-Length: z
Connection: close
{"version":"1.0.0","datastreams" : [ {"id" : "Longitude","current_value" : ""},{"id" : "Latitude","current_value" : ""}]}
Connected to Xively server.
--------------------------------------
HTTP/1.1 411 Length Required
Date: Fri, 08 Aug 2014 13:19:33 GMT
Content-Type: text/html
Content-Length: 181
Connection: close
<html>
<head><title>411 Length Required</title></head>
<body bgcolor="white">
<center><h1>411 Length Required</h1></center>
<hr><center>nginx/1.1.19</center>
</body>
</html>
我理解错误411是对内容长度的调用,但是我已经在我的标题中声明了这个,我仍然会收到此错误。 任何帮助将不胜感激:)
答案 0 :(得分:0)
Content-Length
值必须是数字序列。你发送的是一封信,所以服务器抱怨它没有以正确的格式获得你的标题。
而不是:
Content-Length: z
使用:
Content-Length: 0
如果您实际在请求正文中包含数据,则长度应为编码正文中的八位字节数。