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.

CURLOPT_POST with no CURLOPT_POSTFIELDS

From: Jason Proctor via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 4 Mar 2020 14:59:49 -0800

Dear Curlers,

I saw that the release notes for 7.69 included this --

http: mark POSTs with no body as "upload done" from the start

-- and wondered whether that fixed an issue I had noticed.

The issue is that if you specify CURLOPT_POST but don't specify
CURLOPT_POSTFIELDS, then the library sticks in sending mode and
doesn't call the header or write callbacks, despite the fact that the
server has happily sent a response. Setting CURLOPT_POSTFIELDS to the
empty string results in the correct behaviour.

It's not a huge deal as most of the time you'll be doing both. Also,
it doesn't occur in the command line tool as POST mode is enabled by
supplying some data, so the issue situation never arises.

thanks for listening
Jason_at_Spatial
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-03-05