java - Content-Length header already present -


i using apache httpclient (4.1) included in android execute httpput. have verified have 1 content-length header. however, every time send request, protocol exception content-length header specified.

httpclient client = new defaulthttpclient(); putmethod = new httpput(url + encodedfilename); putmethod.addheader(..)  //<-once each header putmethod.setentity(new bytearrayentity(data)); client.execute(putmethod);  //throws exception 

caused by: org.apache.http.protocolexception: content-length header present @ org.apache.http.protocol.requestcontent.process(requestcontent.java:70) @ org.apache.http.protocol.basichttpprocessor.process(basichttpprocessor.java:290)

any ideas?

i've not used httpclient myself, suspect problem putmethod.setentity(...) implicitly supplying content length , setting explicitly via 1 of putmethod.addheader(...) calls.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -