0

我尝试在带有 mbedOS 的 ODIN-W2 上使用分块 http 请求。我有下一个 http 请求/响应:

POST /post HTTP/1.1<CR><LF>
Accept: */*<CR><LF>
Accept-Encoding: gzip<CR><LF>
Accept-Language: uk,en-US;q=0.8,en;q=0.5,ru;q=0.3<CR><LF>
Cache-Control: no-cache<CR><LF>
Connection: Keep-Alive<CR><LF>
Host: httpbin.org<CR><LF>
Transfer-Encoding: chunked<CR><LF>
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like 
Gecko<CR><LF>
content-type: application/json<CR><LF>
<CR><LF>
6<CR><LF>
ABCDEF<CR><LF>
0<CR><LF>
<CR><LF>
Status: 411 - Length Required<LF>
<LF>
Headers:<LF>
Date: Tue, 24 Apr 2018 08:01:41 GMT<LF>
Connection: close<LF>
Content-Type: text/html<LF>
Server: meinheld/0.6.1<LF>
Via: 1.1 vegur<LF>
<LF>
Body (92 bytes):<LF>
<html><head><title>Length Required</title></head><body><p>Length Required. 
</p></body></html><LF>

我使用 mbedOS 的标准 HTTP 库。

4

1 回答 1

0

这是 httpbin 中的错误,而不是 Mbed HTTP 库中的错误。请参阅https://github.com/requests/httpbin/issues/340。这也是我使用 reqres.in 作为分块请求的示例 URL 的原因。

于 2018-04-30T09:40:51.037 回答