GNURLOPT_REQUEST_TARGET(3)
π NAME π
Okay bestie, welcome to the GNURLOPT_REQUEST_TARGET(3) page from the curl_easy_setopt options manual. This is all about CURLOPT_REQUEST_TARGET β specify an alternative target for this request. That's the whole assignment, no cap. π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_REQUEST_TARGET, string);
π¦ DESCRIPTION π¦
You pass a char * to string, and libcurl uses it in the upcoming request instead of the path as extracted from the URL. Literally that's it, and it's kind of iconic. β¨
π DEFAULT π
The default is NULL. As in, nothing is set unless you set it. π
π PROTOCOLS π
HTTP. That's the vibe. π
π₯ EXAMPLE π₯
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/*");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "OPTIONS");
/* issue an OPTIONS * request (no leading slash) */
curl_easy_setopt(curl, CURLOPT_REQUEST_TARGET, "*");
/* Perform the request */
curl_easy_perform(curl);
}
β AVAILABILITY β
Added in 7.55.0. She's been around, okay? π
π RETURN VALUE π
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. Fr fr, that's the whole return-value tea. π«Ά
π SEE ALSO π
Go peek at CURLOPT_CUSTOMREQUEST(3), CURLOPT_HTTPGET(3), β iykyk. π¦
mwah π that's the page, bestie! libcurl 7.37.0 β’ 17 Jun 2014 β’ GNURLOPT_REQUEST_TARGET(3)
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms