gunar wrote:
> Hi!
> 
> I tried to make an HTTP PUT request to send an xml file to a server.
> Something like:
> 
> DefaultHttpClient httpClient = new DefaultHttpClient();
> HttpPut httpPut = new HttpPut(url_encoded);
> 
> httpPut.setEntity(new StringEntity("<the xml goes here>"));
> httpPut.setHeader("Content-Type", "application/x-www-form-
> urlencoded");
> 
> HttpResponse response = httpClient.execute(httpPost);
> 
> When I check what is being sent, using WireShark, I see the request
> doesn't contain the XML file I posted, as it's request body is
> empty... What am I doing wrong?

If your StringEntity holds XML, then your Content-Type should not be
application/x-www-form-urlencoded. It should be application/xml or
text/xml or something else XML-ish.

I doubt that is the source of your specific difficulty here, but it is
something you will probably need to address at some point.

If you do not get answers here, you might wish to post your query on a
list more suited for HttpClient:

http://hc.apache.org/mail.html

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books.html

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to