title: How to post vector to a HTTP endpoint
body: <p>I have the following data type that is populated in C++</p>
  
  <pre><code>std::vector&lt;uint8_t&gt; bytes;
  </code></pre>
  
  <p>Using libcurl, how do I post this to an HTTP endpoint ?</p>
  
  <p>Tried the following code, but I think it won't work with my post data</p>
  
  <pre><code>CURL *curl;
  CURLcode res;
  
  curl_global_init(CURL_GLOBAL_ALL);
  curl = curl_easy_init();
  if(curl) {
    curl_easy_setopt(curl, CURLOPT_URL, "http://1.2.3.4:9002/multicastdataclient-message");
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, &amp;bytes);
    res = curl_easy_perform(curl);
    if(res != CURLE_OK)
      fprintf(stderr, "curl_easy_perform() failed: %s\n",
              curl_easy_strerror(res));
    curl_easy_cleanup(curl);
  }
  </code></pre>