diff options
Diffstat (limited to 'docs/libcurl/curl_url_get.3')
-rw-r--r-- | docs/libcurl/curl_url_get.3 | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/docs/libcurl/curl_url_get.3 b/docs/libcurl/curl_url_get.3 index a93400bac..34f0b4984 100644 --- a/docs/libcurl/curl_url_get.3 +++ b/docs/libcurl/curl_url_get.3 @@ -19,7 +19,7 @@ .\" * KIND, either express or implied. .\" * .\" ************************************************************************** -.TH curl_url_get 3 "March 27, 2021" "libcurl 7.78.0" "libcurl Manual" +.TH curl_url_get 3 "October 25, 2021" "libcurl 7.80.0" "libcurl Manual" .SH NAME curl_url_get - extract a part from a URL @@ -57,7 +57,7 @@ default port for the scheme. .IP CURLU_URLDECODE Asks \fIcurl_url_get(3)\fP to URL decode the contents before returning it. It will not attempt to decode the scheme, the port number or the full URL. - +ยด The query component will also get plus-to-space conversion as a bonus when this bit is set. @@ -67,6 +67,14 @@ encoding. If there's any byte values lower than 32 in the decoded string, the get operation will return an error instead. +.IP CURLU_URLENCODE +If set, will make \fIcurl_url_get(3)\fP URL encode the host name part when a +full URL is retrieved. If not set (default), libcurl returns the URL with the +host name "raw" to support IDN names to appear as-is. IDN host names are +typically using non-ASCII bytes that otherwise will be percent-encoded. + +Note that even when not asking for URL encoding, the '%' (byte 37) will be URL +encoded to make sure the host name remains valid. .SH PARTS .IP CURLUPART_URL When asked to return the full URL, \fIcurl_url_get(3)\fP will return a @@ -85,15 +93,19 @@ If the host name is a numeric IPv6 address, this field might also be set. .IP CURLUPART_PORT Port cannot be URL decoded on get. .IP CURLUPART_PATH +\fIpart\fP will be '/' even if no path is supplied in the URL. .IP CURLUPART_QUERY +The initial question mark that denotes the beginning of the query part is +a delimiter only. +It is not part of the query contents. + + +A not-present query will lead \fIpart\fP to be set to NULL. +A zero-length query will lead \fIpart\fP to be set to a zero-length string. + The query part will also get pluses converted to space when asked to URL decode on get with the CURLU_URLDECODE bit. .IP CURLUPART_FRAGMENT -.SH RETURN VALUE -Returns a CURLUcode error value, which is CURLUE_OK (0) if everything went -fine. - -If this function returns an error, no URL part is returned. .SH EXAMPLE .nf CURLUcode rc; @@ -110,7 +122,13 @@ If this function returns an error, no URL part is returned. } .fi .SH AVAILABILITY -Added in curl 7.62.0. CURLUPART_ZONEID was added in 7.65.0. +Added in 7.62.0. CURLUPART_ZONEID was added in 7.65.0. +.SH RETURN VALUE +Returns a CURLUcode error value, which is CURLUE_OK (0) if everything went +fine. See the \fIlibcurl-errors(3)\fP man page for the full list with +descriptions. + +If this function returns an error, no URL part is returned. .SH "SEE ALSO" .BR curl_url_cleanup "(3), " curl_url "(3), " curl_url_set "(3), " -.BR curl_url_dup "(3), " CURLOPT_CURLU "(3), " +.BR curl_url_dup "(3), " curl_url_strerror "(3), " CURLOPT_CURLU "(3)" |