zoo api
Makes an authenticated HTTP request to the Zoo API and prints the response.
Options
endpoint
- The endpoint to request
-X/--method
- The HTTP method for the request
--paginate
- Make additional HTTP requests to fetch all pages of results
Default value:false
-F/--field
- Add a typed parameter in key=value format
-f/--raw-field
- Add a string parameter in key=value format
--input
- The file to use as body for the HTTP request (use "-" to read from standard input)
Default value: -i/--include
- Include HTTP response headers in the output
Default value:false
-H/--header
- Add a HTTP request header in
key:value
format -d/--debug
- Print debug info
Default value:false
-h/--help
- Print help (see a summary with '-h')
About
The endpoint argument should be a path of a Zoo API endpoint.
The default HTTP request method is "GET" normally and "POST" if any parameters
were added. Override the method with --method
.
Pass one or more -f/--raw-field
values in "key=value" format to add static string
parameters to the request payload. To add non-string or otherwise dynamic values, see
--field
below. Note that adding request parameters will automatically switch the
request method to POST. To send the parameters as a GET query string instead, use
--method GET
.
The -F/--field
flag has magic type conversion based on the format of the value:
- literal values "true", "false", "null", and integer/float numbers get converted to appropriate JSON types;
- if the value starts with "@", the rest of the value is interpreted as a filename to read the value from. Pass "-" to read from standard input.
Raw request body may be passed from the outside via a file specified by --input
.
Pass "-" to read from standard input. In this mode, parameters specified via
--field
flags are serialized into URL query parameters.
In --paginate
mode, all pages of results will sequentially be requested until
there are no more pages of results.