title: How to use libcurl in c++ to send POST to elasticsearch
body: <p>does anyone knows the exact syntax for using elasticsearch with libcurl?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;curl/curl.h&gt;
  
  int main(void)
  {
     CURL *curl;
     CURLcode res;
  
     curl = curl_easy_init();
  
     curl_easy_setopt(curl, CURLOPT_URL, "http://localhost:9200/bro-201409170900/http/ZinAvJ-ETT-mycy2jyRkdg/_update -d");
     curl_easy_setopt(curl, CURLOPT_POST, 1);
     curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"script\" : \"ctx._source.longitude += 3\"}");
     curl_easy_perform(curl);
     curl_easy_cleanup(curl);
  
     return 1;
  }
  </code></pre>
  
  <p>This code does ont update the longitude parameter and I don't know why.</p>