1curl_url(3) libcurl Manual curl_url(3)
2
3
4
6 curl_url - returns a new CURLU handle
7
9 #include <curl/curl.h>
10
11 CURLU *curl_url();
12
14 The URL API is considered EXPERIMENTAL until further notice. Please
15 test it, report bugs and help us perfect it. Once proven to be reli‐
16 able, the experimental label will be removed.
17
18 While this API is marked experimental, we reserve the right to modify
19 the API slightly if we deem it necessary and it makes it notably better
20 or easier to use.
21
23 This function will allocates and returns a pointer to a fresh CURLU
24 handle, to be used for further use of the URL API.
25
27 Returns a CURLU * if successful, or NULL if out of memory.
28
30 CURLUcode rc;
31 CURLU *url = curl_url();
32 rc = curl_url_set(url, CURLUPART_URL, "https://example.com", 0);
33 if(!rc) {
34 char *scheme;
35 rc = curl_url_get(url, CURLUPART_SCHEME, &scheme, 0);
36 if(!rc) {
37 printf("the scheme is %s0, scheme);
38 curl_free(scheme);
39 }
40 curl_url_cleanup(url);
41 }
42
44 Added in curl 7.62.0
45
47 curl_url_cleanup(3), curl_url_get(3), curl_url_set(3), curl_url_dup(3),
48
49
50
51libcurl 6 Aug 2018 curl_url(3)