mirror of
https://codeberg.org/kiss-community/repo
synced 2024-12-23 07:40:11 -07:00
50 lines
1.2 KiB
Groff
50 lines
1.2 KiB
Groff
.\" generated by cd2nroff 0.1 from curl_url.md
|
|
.TH curl_url 3 "2024-08-02" libcurl
|
|
.SH NAME
|
|
curl_url \- create a URL handle
|
|
.SH SYNOPSIS
|
|
.nf
|
|
#include <curl/curl.h>
|
|
|
|
CURLU *curl_url();
|
|
.fi
|
|
.SH DESCRIPTION
|
|
This function allocates a URL object and returns a \fICURLU\fP handle for it,
|
|
to be used as input to all other URL API functions.
|
|
|
|
This is a handle to a URL object that holds or can hold URL components for a
|
|
single URL. When the object is first created, there is of course no components
|
|
stored. They are then set in the object with the \fIcurl_url_set(3)\fP
|
|
function.
|
|
.SH PROTOCOLS
|
|
This functionality affects all supported protocols
|
|
.SH EXAMPLE
|
|
.nf
|
|
int main(void)
|
|
{
|
|
CURLUcode rc;
|
|
CURLU *url = curl_url();
|
|
rc = curl_url_set(url, CURLUPART_URL, "https://example.com", 0);
|
|
if(!rc) {
|
|
char *scheme;
|
|
rc = curl_url_get(url, CURLUPART_SCHEME, &scheme, 0);
|
|
if(!rc) {
|
|
printf("the scheme is %s\\n", scheme);
|
|
curl_free(scheme);
|
|
}
|
|
curl_url_cleanup(url);
|
|
}
|
|
}
|
|
.fi
|
|
.SH AVAILABILITY
|
|
Added in curl 7.62.0
|
|
.SH RETURN VALUE
|
|
Returns a \fBCURLU \fP* if successful, or NULL if out of memory.
|
|
.SH SEE ALSO
|
|
.BR CURLOPT_CURLU (3),
|
|
.BR curl_url_cleanup (3),
|
|
.BR curl_url_dup (3),
|
|
.BR curl_url_get (3),
|
|
.BR curl_url_set (3),
|
|
.BR curl_url_strerror (3)
|