1CURLOPT_REQUEST_TARGET(3) curl_easy_setopt options CURLOPT_REQUEST_TARGET(3)
2
3
4
6 CURLOPT_REQUEST_TARGET - alternative target for this request
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_REQUEST_TARGET, string);
12
14 Pass a char * to string which libcurl uses in the upcoming request in‐
15 stead of the path as extracted from the URL.
16
18 NULL
19
21 HTTP
22
24 curl = curl_easy_init();
25 if(curl) {
26 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/*");
27 curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "OPTIONS");
28
29 /* issue an OPTIONS * request (no leading slash) */
30 curl_easy_setopt(curl, CURLOPT_REQUEST_TARGET, "*");
31
32 /* Perform the request */
33 curl_easy_perform(curl);
34 }
35
37 Added in 7.55.0
38
40 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
41 if not.
42
44 CURLOPT_CUSTOMREQUEST(3), CURLOPT_HTTPGET(3),
45
46
47
48libcurl 7.82.0 November 26, 2021 CURLOPT_REQUEST_TARGET(3)