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