Content-Length header already present

后端 未结 6 1008
灰色年华
灰色年华 2020-12-15 03:44

I am using the Apache HttpClient (4.1) included in Android to execute a HttpPut. I have verified that I only have 1 content-length header. However, every time I send the r

6条回答
  •  一向
    一向 (楼主)
    2020-12-15 04:01

    If you checkout http://docjar.org/docs/api/org/apache/http/protocol/RequestContent.html you'll notice that it throws that exception if you've set it yourself. Therefore, the internal working set the content length automatically. This also means, to set it to "0", you need to set the entity to null.

提交回复
热议问题