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.
CURLOPT_XOAUTH2_BEARER use?
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Gavin Henry via curl-library <curl-library_at_lists.haxx.se>
Date: Mon, 20 Feb 2023 11:57:13 +0000
Hi all,
I'm reading https://curl.se/libcurl/c/CURLOPT_XOAUTH2_BEARER.html but can't
seem to see the header at all or find any code at
https://github.com/curl/curl/search?q=CURLOPT_XOAUTH2_BEARER
For example?
res = curl_easy_setopt(
curl, CURLOPT_XOAUTH2_BEARER,
"zxczx");
if (res != CURLE_OK) {
fprintf(stderr, "curl_easy_setopt() failed: %s\n",
curl_easy_strerror(res));
free(json_string);
http_cleanup_curl(curl, headers);
return EXIT_FAILURE;
}
}
res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
if (res != CURLE_OK) {
fprintf(stderr, "curl_easy_setopt() failed: %s\n",
curl_easy_strerror(res));
free(json_string);
http_cleanup_curl(curl, headers);
return EXIT_FAILURE;
}
// Send the json :-)
res = curl_easy_perform(curl);
What am I missing? Is it better to just add the header by hand?
Thanks.
Date: Mon, 20 Feb 2023 11:57:13 +0000
Hi all,
I'm reading https://curl.se/libcurl/c/CURLOPT_XOAUTH2_BEARER.html but can't
seem to see the header at all or find any code at
https://github.com/curl/curl/search?q=CURLOPT_XOAUTH2_BEARER
For example?
res = curl_easy_setopt(
curl, CURLOPT_XOAUTH2_BEARER,
"zxczx");
if (res != CURLE_OK) {
fprintf(stderr, "curl_easy_setopt() failed: %s\n",
curl_easy_strerror(res));
free(json_string);
http_cleanup_curl(curl, headers);
return EXIT_FAILURE;
}
}
res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
if (res != CURLE_OK) {
fprintf(stderr, "curl_easy_setopt() failed: %s\n",
curl_easy_strerror(res));
free(json_string);
http_cleanup_curl(curl, headers);
return EXIT_FAILURE;
}
// Send the json :-)
res = curl_easy_perform(curl);
What am I missing? Is it better to just add the header by hand?
Thanks.
-- Kind Regards, Gavin Henry. https://sentrypeer.org
-- Unsubscribe: https://lists.haxx.se/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.htmlReceived on 2023-02-20