On Mon, 21 Aug 2023, Hua-Tong Shi via curl-library wrote:
curl_easy_setopt(curl_ptr, CURLOPT_POST, 1L);
You ask libcurl to do a POST, but without telling it *what* to post. Like
CURLOPT_POSTFIELDS set to "" (a zero length string) since you seem to not want
to actually send any data in the POST.
Without knowing what to post and with no callback set, it reads from stdin by
default.
headers_ptr = curl_slist_append(headers_ptr, "Content-Length: 0");
Then you also won't have to artificially add this header since libcurl will
do that by itself.
--
/ daniel.haxx.se
| Commercial curl support up to 24x7 is available!
| Private help, bug fixes, support, ports, new features
| https://curl.se/support.html
--
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.html