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

NAME

6       curl_url - returns a new URL 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

EXAMPLE

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

AVAILABILITY

32       Added in 7.62.0
33

RETURN VALUE

35       Returns a CURLU * if successful, or NULL if out of memory.
36

SEE ALSO

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 8.0.1                  January 02, 2023                    curl_url(3)
Impressum