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

and created a pull request with a fix:

  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
Received on 2021-01-14