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,
12       string);
13

DESCRIPTION

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

DEFAULT

19       NULL
20

PROTOCOLS

22       HTTP
23

EXAMPLE

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

AVAILABILITY

38       Added in 7.55.0
39

RETURN VALUE

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

SEE ALSO

45       CURLOPT_CUSTOMREQUEST(3), CURLOPT_HTTPGET(3),
46
47
48
49libcurl 7.79.1                September 08, 2021     CURLOPT_REQUEST_TARGET(3)
Impressum