curlz
curlz copied to clipboard
http language: variable assignment
Extension to the http language file format #5
A request can declare variables that are available as regular variables.
A new variable is declared by the prefix @ in front of the variable name.
Example
###
@id = 2
@hostname = httpbin.org
@port = 443
@host = {{hostname}}:{{port}}
GET https://{{host}}/get?id={{id}} HTTP/1.1
Example CLI
the equivalent via the CLI is this:
curlz r --define id=2 \
--define hostname=httpbin.org \
--define port=443 \
--define 'host={{hostname}}:{{port}}' \
'https://{{host}}/get?id={{id}}'