Is there a way to send a HTTP get request using libcurl in JSON format?
My current request is
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://localhost:9200/_search?q=tag:warcraft")
using libcurl. It's equivalent in curl is
curl -XGET http://localhost:9200/_all/tweet/_search?q=tag:warcraft
I would like to send the following curl request (in json format) using libcurl.
curl -XGET http://localhost:9200/_search -d '{
"query" : {
"term" : { "tag": "warcraft" }
}
}'
I would like to know the equivalent libcurl code to send the above request. Thanks.