_VARIABLES.md: improve the description

Closes #13040
This commit is contained in:
Daniel Stenberg 2024-03-04 14:26:14 +01:00
parent 36a95c5163
commit e455490c3c
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -26,15 +26,15 @@ set:
When expanding variables, curl supports a set of functions that can make the
variable contents more convenient to use. It can trim leading and trailing
white space with *trim*, it can output the contents as a JSON quoted string
with *json*, URL encode the string with *url* or base64 encode it with
*b64*. You apply function to a variable expansion, add them colon separated to
the right side of the variable. Variable content holding null bytes that are
not encoded when expanded cause error.
white space with `trim`, it can output the contents as a JSON quoted string
with `json`, URL encode the string with `url` or base64 encode it with `b64`.
To apply functions to a variable expansion, add them colon separated to the
right side of the variable. Variable content holding null bytes that are not
encoded when expanded cause error.
Example: get the contents of a file called $HOME/.secret into a variable
called "fix". Make sure that the content is trimmed and percent-encoded sent
as POST data:
called "fix". Make sure that the content is trimmed and percent-encoded when
sent as POST data:
--variable %HOME
--expand-variable fix@{{HOME}}/.secret