Sortix cross-nightly manual
This manual documents Sortix cross-nightly. You can instead view this document in the latest official manual.
CURLOPT_CUSTOMREQUEST(3) | Library Functions Manual | CURLOPT_CUSTOMREQUEST(3) |
NAME
CURLOPT_CUSTOMREQUEST - custom request methodSYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CUSTOMREQUEST, char *method);
DESCRIPTION
Pass a pointer to a null-terminated string as parameter.- HTTP
-
Instead of GET or HEAD when performing HTTP based requests. This is particularly useful, for example, for performing an HTTP DELETE request.
- FTP
- Instead of LIST and NLST when performing FTP directory listings.
- IMAP
- Instead of LIST when issuing IMAP based requests.
- POP3
-
Instead of LIST and RETR when issuing POP3 based requests.
- SMTP
-
Instead of a HELP or VRFY when issuing SMTP based requests.
DEFAULT
NULLPROTOCOLS
This functionality affects ftp, http, imap, pop3 and smtpEXAMPLE
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
/* DELETE the given path */
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
AVAILABILITY
Added in curl 7.1RETURN VALUE
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space.SEE ALSO
CURLINFO_EFFECTIVE_METHOD(3), CURLOPT_HTTPHEADER(3), CURLOPT_NOBODY(3), CURLOPT_REQUEST_TARGET(3)2024-11-24 | libcurl |