1curl_url(3)                     libcurl Manual                     curl_url(3)
2
3
4

NAME

6       curl_url - returns a new CURLU handle
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLU *curl_url();
12

DESCRIPTION

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

RETURN VALUE

18       Returns a CURLU * if successful, or NULL if out of memory.
19

EXAMPLE

21         CURLUcode rc;
22         CURLU *url = curl_url();
23         rc = curl_url_set(url, CURLUPART_URL, "https://example.com", 0);
24         if(!rc) {
25           char *scheme;
26           rc = curl_url_get(url, CURLUPART_SCHEME, &scheme, 0);
27           if(!rc) {
28             printf("the scheme is %s\n", scheme);
29             curl_free(scheme);
30           }
31           curl_url_cleanup(url);
32         }
33

AVAILABILITY

35       Added in curl 7.62.0
36

SEE ALSO

38       curl_url_cleanup(3), curl_url_get(3), curl_url_set(3), curl_url_dup(3),
39       CURLOPT_CURLU(3),
40
41
42
43libcurl 7.79.1                  March 27, 2021                     curl_url(3)
Impressum