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

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

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -