我正在使用Apache的HttpClient做一些工作,并看到这个错误:
http客户端发生意外错误。 org.apache.commons.httpclient.ProtocolException:无法重复未缓冲的实体封闭请求。
知道是什么原因引起的吗?
I'm doing some work with Apache's HttpClient, and see this error:
Unexpected error occurred in http client. org.apache.commons.httpclient.ProtocolException: Unbuffered entity enclosing request can not be repeated.
Any idea what's causing it?
最满意答案
在我的情况下,这意味着我试图连接到只使用https真正支持http的服务器。
因此,如果您真的应该使用http请检查您是否使用https
信息qtp1765745171-29 - POST / test 2016-02-18 14:16:50,708
[发送] POST https :// localhost:8080 / testpage
In my situation, this meant I was trying to connect to a server that only really supported http using https.
So check if you're using https when you should really be using http
INFO qtp1765745171-29 - POST /test 2016-02-18 14:16:50,708
[SENDING] POST https://localhost:8080/testpage
or, it could mean that you have a proxy server in front of your https server that's still sending a response, but in http not https
http客户端发生意外错误。(Unexpected error occurred in http client. org.apache.commons.httpclient.ProtocolException: Unbuffered entity enclosing request can not be repeated) java我正在使用Apache的HttpClient做一些工作,并看到这个错误:
http客户端发生意外错误。 org.apache.commons.httpclient.ProtocolException:无法重复未缓冲的实体封闭请求。
知道是什么原因引起的吗?
I'm doing some work with Apache's HttpClient, and see this error:
Unexpected error occurred in http client. org.apache.commons.httpclient.ProtocolException: Unbuffered entity enclosing request can not be repeated.
Any idea what's causing it?
最满意答案
在我的情况下,这意味着我试图连接到只使用https真正支持http的服务器。
因此,如果您真的应该使用http请检查您是否使用https
信息qtp1765745171-29 - POST / test 2016-02-18 14:16:50,708
[发送] POST https :// localhost:8080 / testpage
In my situation, this meant I was trying to connect to a server that only really supported http using https.
So check if you're using https when you should really be using http
INFO qtp1765745171-29 - POST /test 2016-02-18 14:16:50,708
[SENDING] POST https://localhost:8080/testpage
or, it could mean that you have a proxy server in front of your https server that's still sending a response, but in http not https
发布评论