curl_easy_escape: elaborate a little on encoding a URL

Closes #14069
This commit is contained in:
Daniel Stenberg 2024-07-01 10:11:39 +02:00
parent 5942b7934d
commit ecd654e12e
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 14 additions and 2 deletions

View File

@ -6,7 +6,8 @@ Section: 3
Source: libcurl
See-also:
- curl_easy_unescape (3)
- curl_free (3)
- curl_url_set (3)
- curl_url_get (3)
Protocol:
- All
---
@ -51,6 +52,17 @@ uses.
The caller of curl_easy_escape(3) must make sure that the data passed in
to the function is encoded correctly.
# URLs
URLs are by definition *URL encoded*. To create a proper URL from a set of
components that may not be URL encoded already, you cannot just URL encode the
entire URL string with curl_easy_escape(3), because it then also converts
colons, slashes and other symbols that you probably want untouched.
To create a proper URL from strings that are not already URL encoded, we
recommend using libcurl's URL API: set the pieces with curl_url_set(3) and get
the final correct URL with curl_url_get(3).
# EXAMPLE
~~~c

View File

@ -6,7 +6,7 @@ Section: 3
Source: libcurl
See-also:
- curl_easy_escape (3)
- curl_free (3)
- curl_url_get (3)
Protocol:
- All
---