Turning two command-line curl calls into c++, using libcurl

2022-05-23 Thread J via curl-library
Hi! I'm trying to turn a (working) command-line call to curl into an equivalent c++ program. The following command line I was able to translate into c++ curl --location --request POST 'https://servername.domain/token' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencod

Re: Turning two command-line curl calls into c++, using libcurl

2022-05-23 Thread Daniel Stenberg via curl-library
On Mon, 23 May 2022, J via curl-library wrote: curl_easy_setopt( curl, CURLOPT_HEADER, "Content-Type: application/x-www-form-urlencoded" ); curl_easy_setopt( curl, CURLOPT_HEADER, ( ( (std::string)"Authorization: Bearer" ) + token ).c_str() ); These are wrong. "CURLOPT_HEADER

Re: Turning two command-line curl calls into c++, using libcurl

2022-05-24 Thread Ray Satiro via curl-library
On 5/23/2022 11:15 AM, J via curl-library wrote: > I'm trying to turn a (working) command-line call to curl into an > equivalent c++ program. Use option --libcurl filename.c and the curl tool will generate C code for libcurl. [1] [1]: https://curl.se/docs/manpage.html#--libcurl -- Unsubscribe

Re: Turning two command-line curl calls into c++, using libcurl

2022-05-24 Thread J via curl-library
Ray, thank you very much for the info, I didn't know that was a possibility. I tried it and was able to extract the necessary libcurl calls to succeed. Thank you again On Tue, 24 May 2022 at 03:17, Ray Satiro via curl-library < curl-library@lists.haxx.se> wrote: > On 5/23/2022 11:15 AM, J via cur