title: C++: How can I Send binary data(protobuf data) using HTTP post request through a curl call
body: <p>I am trying trying to make a POST request on a url with protobuf data. I don't know how/ where to add binary data. Below is my C++ program.
  "</p>
  
  <pre><code>void sendContent()
  {
      using namespace std;
      int Error = 0;
      //CString str;
  
      CURL* curl;
      CURLcode res;
  
      struct curl_slist *headerlist = NULL;
      curl_global_init(CURL_GLOBAL_ALL);
  
      curl = curl_easy_init();
  
      headerlist = curl_slist_append(headerlist, "Content-Type: application/x-protobuf");
  
      //Set URL to recevie POST
      curl_easy_setopt(curl, CURLOPT_VERBOSE, true);
      curl_easy_setopt(curl, CURLOPT_POST, true);
      curl_easy_setopt(curl, CURLOPT_HEADER, true);
      curl_easy_setopt(curl, CURLOPT_URL, "http://localhost:9090/info");  
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
  
      res = curl_easy_perform(curl);
  
      curl_easy_cleanup(curl);
      curl_global_cleanup();
  
  }"
  </code></pre>