From 9294ca89163951e1d8e949c2af964197de1be2cb Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 14 Dec 2024 14:32:18 +0100 Subject: [PATCH] variable.md: show function use with examples Closes #15743 --- docs/cmdline-opts/variable.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/cmdline-opts/variable.md b/docs/cmdline-opts/variable.md index 9fe0572363..d9a008ea87 100644 --- a/docs/cmdline-opts/variable.md +++ b/docs/cmdline-opts/variable.md @@ -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}}