EDIT :
I am trying to send an xml file as a post request in Android.
The server accepts text/xml. I tried creating a MultipartEntity, which has a content type of multipart/form-data.
HttpClient httpClient = new DefaultHttpClient();
/* New Post Request */
HttpPost postRequest = new HttpPost(url);
byte[] data = IOUtils.toByteArray(payload);
/* Body of the Request */
InputStreamBody isb = new InputStreamBody(new ByteArrayInputStream(data), "uploadedFile");
MultipartEntity multipartContent = new MultipartEntity();
multipartContent.addPart("uploadedFile", isb);
/* Set the Body of the Request */
postRequest.setEntity(multipartContent);
/* Set Authorization Header */
postRequest.setHeader("Authorization", authHeader);
HttpResponse response = httpClient.execute(postRequest);
InputStream content = response.getEntity().getContent();
return content;
However I get an error saying the content type cannot be consumed.
The server refused this request because the request entity is in a format not supported by the requested resource for the requested method (Cannot consume content type).
How do I change the content type of the request?
Edit: