title: Content-Type: application/x-www-form-urlencoded in curl
body: <p>I am trying to write a c++ program which uses curl library to perform action(creating VM etc) on Red Hat Enterprise Virtualizatio (RHEV). I am using CURL handler to perform a post action (creating VM).</p>
  
  <pre><code>CURL *curl;
  
  struct curl_slist *headers=NULL; // init to NULL is important
  
  curl_slist_append(headers, "Accept: application/xml");
  curl_slist_append( headers, "Content-Type: application/xml");
  
  /* get a curl handle */
  curl = curl_easy_init();
  if(curl) {
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  </code></pre>
  
  <p>But when I run this code I get </p>
  
  <pre><code>HTTP Status 415 - Cannot consume content type
  Cannot consume content type
  The server refused this request because the request entity is in a format not supported by the requested resource for the requested method.
  </code></pre>
  
  <p>I checked with the debugger even if I am setting content-type as xml it is coming as</p>
  
  <pre><code>0087: Accept: */*
  0094: Content-Length: 173
  00a9: Content-Type: application/x-www-form-urlencoded
  </code></pre>
  
  <p>Could someone help me figure out what is happening? Great thanks in advance!</p>