]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_url_get.md: clarify queries and fragments and CURLU_GET_EMPTY
authorDaniel Stenberg <daniel@haxx.se>
Thu, 18 Apr 2024 12:39:21 +0000 (14:39 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 18 Apr 2024 14:13:34 +0000 (16:13 +0200)
Follow-up to 3eac21d86bc5

Closes #13407

docs/libcurl/curl_url_get.md

index 100eea7f523874b99350cfce0934ecf6be0f7f86..54041180fa129a08fb2a09cedf1161b906b09dd0 100644 (file)
@@ -129,12 +129,15 @@ nothing following the hash sign.
 
 ## CURLUPART_URL
 
-When asked to return the full URL, curl_url_get(3) returns a normalized
-and possibly cleaned up version using all available URL parts.
+When asked to return the full URL, curl_url_get(3) returns a normalized and
+possibly cleaned up version using all available URL parts.
 
-We advise using the *CURLU_PUNYCODE* option to get the URL as "normalized"
-as possible since IDN allows hostnames to be written in many different ways
-that still end up the same punycode version.
+We advise using the *CURLU_PUNYCODE* option to get the URL as "normalized" as
+possible since IDN allows hostnames to be written in many different ways that
+still end up the same punycode version.
+
+Zero-length queries and fragments are excluded from the URL unless
+CURLU_GET_EMPTY is set.
 
 ## CURLUPART_SCHEME
 
@@ -181,7 +184,8 @@ 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 returns *part* set to NULL.
-A zero-length query returns *part* as a zero-length string.
+
+A zero-length query returns *part* as NULL unless CURLU_GET_EMPTY is set.
 
 The query part gets pluses converted to space when asked to URL decode on get
 with the CURLU_URLDECODE bit.
@@ -191,6 +195,10 @@ with the CURLU_URLDECODE bit.
 The initial hash sign that denotes the beginning of the fragment is a
 delimiter only. It is not part of the fragment contents.
 
+A not-present fragment returns *part* set to NULL.
+
+A zero-length fragment returns *part* as NULL unless CURLU_GET_EMPTY is set.
+
 # EXAMPLE
 
 ~~~c