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: curl_mime_* API: how to send post request with empty body?

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 14 Jan 2021 16:36:32 +0100 (CET)

On Mon, 11 Jan 2021, Christoph M. Becker via curl-library wrote:

> I wanted to send a post request with an empty body, and found that
>
> curl_easy_setopt(handle, CURLOPT_MIMEPOST, NULL);
>
> allows me to do so.

There are other ways to do it as well, like setting CURLOPT_POSTFIELDS to a
zero length string.

> But it does not work to reset a formerly set mimepost, e.g.

This is a bug. I filed it on GitHub:
   https://github.com/curl/curl/issues/6455

and created a pull request with a fix:
   https://github.com/curl/curl/pull/6456

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://www.wolfssl.com/contact/
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2021-01-14