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 This function will allocates and returns a pointer to a fresh CURLU
15 handle, to be used for further use of the URL API.
16
18 CURLUcode rc;
19 CURLU *url = curl_url();
20 rc = curl_url_set(url, CURLUPART_URL, "https://example.com", 0);
21 if(!rc) {
22 char *scheme;
23 rc = curl_url_get(url, CURLUPART_SCHEME, &scheme, 0);
24 if(!rc) {
25 printf("the scheme is %s\n", scheme);
26 curl_free(scheme);
27 }
28 curl_url_cleanup(url);
29 }
30
32 Added in 7.62.0
33
35 Returns a CURLU * if successful, or NULL if out of memory.
36
38 curl_url_cleanup(3), curl_url_get(3), curl_url_set(3), curl_url_dup(3),
39 curl_url_strerror(3), CURLOPT_CURLU(3)
40
41
42
43libcurl 7.85.0 May 17, 2022 curl_url(3)