title: HTTP Header not set using Curl in C++
body: <p>I'm very new to HTTP commands and the libcurl library, so there is a good chance that I'm not understanding something fundamental. That said, I am trying to set headers using curl in C++ but when I try to get the Content-Type, a null value is returned. I am not able to figure out why this is happening. Here is the piece of code:</p>
  
  <pre><code>// HTTP headers to send with request
     struct curl_slist* headers = nullptr;
  
  // Set Content-Type to application/x-hybrid-thrift-binary
     headers = curl_slist_append(headers, "Content-Type: application/x-hybrid-thrift-binary");
  
     curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
     CURLcode ret = curl_easy_perform(curl);
  
  // Extract the content-type
     char *ct = nullptr;
     ret = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &amp;ct);
     if(!ret) {
       printf("Content-Type: %s\n", ct);
     }
  </code></pre>
  
  <p>Any help would be highly appreciated!!!</p>