title: Using Android to Post XML files
body: <p>EDIT :</p>
  
  <p>I am trying to send an xml file as a post request in Android.</p>
  
  <p>The server accepts text/xml. I tried creating a MultipartEntity, which has a content type of multipart/form-data. </p>
  
  <pre><code> 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;
  </code></pre>
  
  <p>However I get an error saying the content type cannot be consumed. </p>
  
  <pre><code>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).
  </code></pre>
  
  <p><strong>How do I change the content type of the request?</strong></p>
  
  <p>Edit:</p>