1CURLOPT_REQUEST_TARGET(3)  curl_easy_setopt options  CURLOPT_REQUEST_TARGET(3)
2
3
4

NAME

6       CURLOPT_REQUEST_TARGET - alternative target for this request
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_REQUEST_TARGET, string);
12

DESCRIPTION

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

DEFAULT

18       NULL
19

PROTOCOLS

21       HTTP
22

EXAMPLE

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

AVAILABILITY

37       Added in 7.55.0
38

RETURN VALUE

40       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
41       if not.
42

SEE ALSO

44       CURLOPT_CUSTOMREQUEST(3), CURLOPT_HTTPGET(3),
45
46
47
48libcurl 7.85.0                   May 17, 2022        CURLOPT_REQUEST_TARGET(3)
Impressum