Command line interface for HTTP requests defined in yaml configuration file.
pip install adz
Having a yaml configuration file
endpoints:
endpoint:
request: GET https://httpbin.org/get
headers:
Content-Type: application/json
and running on command line
adz endpoint
will execute endpoint
request defined in configuration file and print
GET https://httpbin.org/get
HTTP/1.1 200 OK
• access-control-allow-credentials: true
• access-control-allow-origin: *
• content-encoding: gzip
• content-type: application/json
• date: Thu, 06 Jun 2019 06:06:06 GMT
• referrer-policy: no-referrer-when-downgrade
• server: nginx
• x-content-type-options: nosniff
• x-frame-options: DENY
• x-xss-protection: 1; mode=block
• content-length: 204
• connection: keep-alive
{
"args": {},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"Content-Type": "application/json",
"Host": "httpbin.org",
"User-Agent": "python-httpx/0.7.1"
},
"url": "https://httpbin.org/get"
}
For an example configuration look at docs/example.yml.
- colors:
bool
, default:true
- control output print in colors
- response:
bool
, default:true
- control response body output
- theme:
str
, defaultnative
- any theme name from here should work
- used to interpolate values in headers and urls
variable: abc
applied onurl: http://example.org/$variable
results inhttp://example.org/abc
- variable value starting with
file://
is opened as file and loaded as string into variable
- description
- method
- http methods
- url
- request
method url
e.g.get http://example.org
- params
- query string parameters
- headers
- json
- json string
- string starting with
file://
is loaded as json file
- data
- json string
- string starting with
file://
is loaded as json file
- cookies
- files
- path to a file:
path/to/file.txt
- file name and path:
filename: path/to/file.txt
- path to a file:
adz.yaml
oradz.yml
api.yaml
orapi.yml
rest.yaml
orrest.yml
- current location:
.
- user's home:
~/
.adz
directory in user's home e.g.~/.adz/
Configuration file path can also be set using environmental variable ADZ
.
Run adz -h
-
adz --config
,adz -c
- path to yaml configuration file
-
adz --details <endpoint>
,adz -d <endpoint>
- output details about endpoint from configuration file
-
adz --list
,adz -l
- list available endpoints in configuration file
-
adz --output
,adz -o
- output processed configuration file as json
-
adz --settings
,adz -s
- output settings in configuration file
-
adz --var name=value
,adz -v name=value
- set or override variables in configuration
-
adz --colors
,adz --no-colors
- control output print in colors
-
adz --response
,adz --no-response
- control response body output
ADZ is licensed under a three clause BSD License. Full license text can be found here.