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

NAME

6       CURLOPT_CURLU - set URL with CURLU *
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 very well update the contents
23       of the URL handle after a transfer is done and if the  same  handle  is
24       then  used  in  a  subsequent request the updated contents will then be
25       used.
26

DEFAULT

28       The default value of this parameter is NULL.
29

PROTOCOLS

31       All
32

EXAMPLE

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

AVAILABILITY

50       Added in 7.63.0.
51

RETURN VALUE

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

SEE ALSO

57       CURLOPT_URL(3), curl_url(3), curl_url_get(3), curl_url_set(3),
58
59
60
61libcurl 7.66.0                 January 16, 2019               CURLOPT_CURLU(3)
Impressum