日期:2014-05-20  浏览次数:20759 次

httpclient4的问题。。请大家帮帮忙!很急!!!1
httpclient 中 如果我手动设置Content-Length就会出现
这样的错误这是为什么啊!!!请大家帮帮忙很急!!
Java code


org.apache.http.client.ClientProtocolException
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:822)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
    at com.li.util.SendRequest.sendPost(SendRequest.java:47)
    at com.li.ndws.imple.ZhongGuanCun.reply(ZhongGuanCun.java:86)
    at com.li.ndws.imple.ZhongGuanCun.main(ZhongGuanCun.java:124)
Caused by: org.apache.http.ProtocolException: Content-Length header already present
    at org.apache.http.protocol.RequestContent.process(RequestContent.java:67)
    at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
    at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:174)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:452)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
    ... 5 more




------解决方案--------------------