java - 400 error after adding "Content-Encoding" header to request -


i'm trying post call adding "content-encoding" header request. here code

invocation.builder builder =   webtarget.request(mediatype.application_xml).header("content-encoding",  "xml").accept(mediatype.text_plain); string xmlrequest=  buildmerchantpreferencesrequest(accountnumber,emailid,thresholdvalue); response = header.post(entity.xml(xmlrequest.tostring()));  string value = response.readentity(string.class); thread.sleep(5000); system.out.println("service status : "+response.getstatus()); system.out.println("response message : "+value); 

returns response follows : status : 400 response message : request service preferenceslifecycle version 1.0- 211.0-35789706 missing content-encoding header

response says "content-encoding" header missing. can me here, , point me right way of doing it?


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -