curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Performing a GET request with JSON

From: Zakrzewski, Jakub via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 20 Aug 2020 06:27:45 +0000

> std::string temp = "{ \"pin\":\"A string\" }";
> curl_easy_setopt(curl, CURLOPT_POST, 1L);
> curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, temp.size());
> curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, temp.c_str());
> curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");

This is not going to do what you want. It'll send a GET request with a body.
Try running your curl command with the "--libcurl" parameter - it'll generate a bit of C code you can look at.

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-08-20