1CURLOPT_CURLU(3) curl_easy_setopt options CURLOPT_CURLU(3)
2
3
4
6 CURLOPT_CURLU - URL in CURLU * format
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CURLU, void *pointer);
12
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
28 The default value of this parameter is NULL.
29
31 All
32
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, "https://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
50 Added in 7.63.0.
51
53 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
54 if not.
55
57 CURLOPT_URL(3), curl_url(3), curl_url_get(3), curl_url_set(3),
58 curl_url_dup(3), curl_url_cleanup(3),
59
60
61
62libcurl 7.79.1 September 08, 2021 CURLOPT_CURLU(3)