2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-12-24 16:30:04 -07:00
repo/core/curl/files/curl_url.3

50 lines
1.2 KiB
Groff
Raw Normal View History

.\" generated by cd2nroff 0.1 from curl_url.md
2024-07-29 18:00:04 -06:00
.TH curl_url 3 "2024-07-29" libcurl
.SH NAME
2024-07-29 18:00:04 -06:00
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.
2024-03-30 12:28:04 -06:00
.SH PROTOCOLS
2024-07-29 18:00:04 -06:00
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
2024-07-29 18:00:04 -06:00
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)