Where should I be setting the Content Type when I'm posting and XML string?

HttpPost httppost = new HttpPost("http://localhost:8080/REST";);
// Make sure the server knows what kind of a response we will accept
httppost.addHeader("Accept", "text/xml");
// Also be sure to tell the server what kind of content we are sending
httppost.addHeader("Content-Type", "application/xml");

or

StringEntity stringEntity = new
StringEntity("<printparamaters><request>1</request></printparamaters>","UTF-8");
stringEntity.setContentType("application/xml");

-- 
Zachariah Young
http://zachariahyoung.com
[email protected]
(479) 966-9169

Reply via email to