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: Problem trying to use Curl in C++ to get http response string after sending http string to server.

From: Dan Fandrich via curl-library <curl-library_at_cool.haxx.se>
Date: Fri, 25 Sep 2020 10:41:12 -0700

On Fri, Sep 25, 2020 at 04:01:08PM +0000, José Fernández via curl-library wrote:
> When the program tries to get the response from the server sends it always
> shows on the screen:
> curl_easy_perform() failed to get answer: Timeout was reached
> I have tried to increase the timeout and I get the same error.

It sounds like perhaps the server isn't sending a properly-formatted reply so
libcurl times out waiting for it. Try using the debug callbacks or Wireshark to
see what the server is returning.

Also, there's something odd about the program. It's structured to perform two
independent transfers, but the first specifies no destination for the received
data (so it will go to stdout) while the second specifies no source for the
data to send (so it will repeat the POST). I'm guessing that perhaps you really
wanted was to perform a single transfer rather than two, which would involve
moving the CURLOPT_WRITE* options into the first transfer.

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