mirror of
https://github.com/curl/curl.git
synced 2026-08-26 10:33:33 +03:00
var: add a '64dec' function that can base64 decode a string
Verified in test 455 and 487. If the provided string cannot be base64-decoded, it will instead use "[64dec-fail]" (without the quotes). Documented Ref: #16288 Closes #16330
This commit is contained in:
parent
54c07fd6c5
commit
a6e8ead533
6 changed files with 101 additions and 11 deletions
|
|
@ -66,30 +66,45 @@ error.
|
|||
|
||||
Available functions:
|
||||
|
||||
## trim
|
||||
## `trim`
|
||||
|
||||
removes all leading and trailing white space.
|
||||
|
||||
Example:
|
||||
|
||||
curl --expand-url https://example.com/{{var:trim}}
|
||||
|
||||
## json
|
||||
## `json`
|
||||
|
||||
outputs the content using JSON string quoting rules.
|
||||
|
||||
Example:
|
||||
|
||||
curl --expand-data {{data:json}} https://example.com
|
||||
|
||||
## url
|
||||
## `url`
|
||||
|
||||
shows the content URL (percent) encoded.
|
||||
|
||||
Example:
|
||||
|
||||
curl --expand-url https://example.com/{{path:url}}
|
||||
|
||||
## b64
|
||||
## `b64`
|
||||
|
||||
expands the variable base64 encoded
|
||||
|
||||
Example:
|
||||
|
||||
curl --expand-url https://example.com/{{var:b64}}
|
||||
|
||||
## `64dec`
|
||||
|
||||
decodes a base64 encoded character sequence. If the sequence is not possible
|
||||
to decode, it instead outputs `[64dec-fail]`
|
||||
|
||||
Example:
|
||||
|
||||
curl --expand-url https://example.com/{{var:64dec}}
|
||||
|
||||
(Added in 8.13.0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue