http 客户端发生意外错误。 org.apache.commons.httpclient.ProtocolException: Unbuffered entity enclosing request cannot be repeated

Unexpected error occurred in http client. org.apache.commons.httpclient.ProtocolException: Unbuffered entity enclosing request can not be repeated

我正在使用 Apache 的 HttpClient 做一些工作,看到这个错误:

Unexpected error occurred in http client. org.apache.commons.httpclient.ProtocolException: Unbuffered entity enclosing request can not be repeated.

知道是什么原因造成的吗?

在我的情况下,这意味着我正在尝试使用 https 连接到仅真正支持 http 的服务器。

因此,请检查您是否在真正应该使用 http

时使用 https

信息 qtp1765745171-29 - POST /测试 2016-02-18 14:16:50,708

[发送] POST https://localhost:8080/testpage

或者,这可能意味着您的 https 服务器前面有一个代理服务器仍在发送响应,但在 http 中不是 https