title: 415 Unsupported Media Type for XML Post Rest API
body: <p>I am trying to Request for REST POST API with XML string but I am getting following error response.  </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;apiErrors&gt;    
     &lt;apiError&gt;        
        &lt;errorMessage&gt;415 Unsupported Media Type - null&lt;/errorMessage&gt;    
     &lt;/apiError&gt;
  &lt;/apiErrors&gt;
  </code></pre>
  
  <p>I don't understand why this happening. Even I set content-type and header also.  </p>
  
  <p>Please take a look at my code.  </p>
  
  <pre><code>String XmlString = "&lt;Contact&gt;"
                                  +"&lt;name&gt;Sandeep&lt;/name&gt;"
                                  +"&lt;title&gt;Mr.&lt;/title&gt;"
                                  +"&lt;Address&gt;India&lt;/Address&gt;"                                 
                                  +"&lt;/Contact&gt;";      
  
              try {
                  StringEntity se = new StringEntity(XmlString);
                  HttpPost httpRequest = new HttpPost("http://abc:xyz123@000.000.000.00:8080/aaa/sample/feed/000001");
                  httpRequest.setHeader("Content-Type","application/soap-xml;charset=UTF-8");
                  httpRequest.setHeader("Accept","text/plain");
  
                  httpRequest.setEntity(se);
                  HttpClient httpclient = new DefaultHttpClient();
                  HttpResponse httpResponse;
                  httpResponse = httpclient.execute(httpRequest, new BasicHttpContext());
  
                  finalres = inputStreamToString(httpResponse.getEntity().getContent())
                              .toString();
  </code></pre>
  
  <p>Please give me hint or reference. </p>