Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http language: variable assignment #18

Open
sassman opened this issue Jan 7, 2023 · 0 comments
Open

http language: variable assignment #18

sassman opened this issue Jan 7, 2023 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@sassman
Copy link
Member

sassman commented Jan 7, 2023

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}}'
@sassman sassman added the enhancement New feature or request label Jan 7, 2023
@sassman sassman added this to the http language milestone Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant