curl / Mailing Lists / curl-library / Single Mail

curl-library

Sending out an HTTP DELETE with a body through libcurl

From: Martin Galvan via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 2 Jan 2018 20:35:06 -0300

Hi all,

I noticed there's currently no way to send an HTTP DELETE request
using curl_easy_setup other than using CURLOPT_CUSTOMREQUEST. I saw
that many people say that the request's body should be specified
through CURLOPT_POSTFIELDS, but the documentation clearly says: "Using
CURLOPT_POSTFIELDS implies CURLOPT_POST". The CUSTOMREQUEST
documentation in turn isn't clear of what the effect of doing this is,
other than "to switch to a proper POST use CURLOPT_POST or
CURLOPT_POSTFIELDS" which sounds to me like using POSTFIELDS will
result in a POST being sent.

What's the proper way to send out DELETE requests?
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-01-03