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

NAME

6       CURLOPT_CURLU - URL in CURLU * format
7

SYNOPSIS

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

DESCRIPTION

14       Pass  in  a  pointer to the URL to work with. The parameter should be a
15       CURLU  *.  Setting  CURLOPT_CURLU(3)  will  explicitly  override   CUR‐
16       LOPT_URL(3).
17
18       CURLOPT_URL(3)  or  CURLOPT_CURLU(3)  must  be set before a transfer is
19       started.
20
21       libcurl will use this handle and its contents read-only  and  will  not
22       change  its contents. An application can update the contents of the URL
23       handle after a transfer is done and if the same handle is then used  in
24       a subsequent request the updated contents will then be used.
25

DEFAULT

27       The default value of this parameter is NULL.
28

PROTOCOLS

30       All
31

EXAMPLE

33       CURL *handle = curl_easy_init();
34       CURLU *urlp = curl_url();
35       int res = 0;
36       if(curl) {
37
38         res = curl_url_set(urlp, CURLUPART_URL, "https://example.com", 0);
39
40         curl_easy_setopt(handle, CURLOPT_CURLU, urlp);
41
42         ret = curl_easy_perform(handle);
43
44         curl_url_cleanup(urlp);
45         curl_easy_cleanup(handle);
46       }
47

AVAILABILITY

49       Added in 7.63.0.
50

RETURN VALUE

52       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
53       if not.
54

SEE ALSO

56       CURLOPT_URL(3),    curl_url(3),    curl_url_get(3),    curl_url_set(3),
57       curl_url_dup(3), curl_url_cleanup(3), curl_url_strerror(3)
58
59
60
61libcurl 7.85.0                   May 17, 2022                 CURLOPT_CURLU(3)
Impressum