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: help - libcurl frozen when retrieve token from microsoft cognitive api

From: Daniel Stenberg via curl-library <>
Date: Mon, 21 Aug 2023 13:38:02 +0200 (CEST)

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

> 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.

  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
Received on 2023-08-21