variable.md: show function use with examples

Closes #15743
This commit is contained in:
Daniel Stenberg 2024-12-14 14:32:18 +01:00
parent cd80716cb6
commit 9294ca8916
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -48,11 +48,27 @@ Available functions:
## trim
removes all leading and trailing white space.
Example:
curl --expand-url https.//example.com/{{url:trim}}
## json
outputs the content using JSON string quoting rules.
Example:
curl --expand-data {{data:json}} https://example.com
## url
shows the content URL (percent) encoded.
Example:
curl --expand-url https://example.com/{{path:url}}
## b64
expands the variable base64 encoded
Example:
curl --expand-url https://example.com/{{var:b64}}