ResponseMate is a command line tool that aims to make inspecting and recording HTTP requests/responses. It is designed with APIs in mind.
It is a cli supplement/replacement of postman
gem install response_mate
For a list of available commands run response_mate help
For help on a command run response_mate help some_command
A specific directory structure must be present to store the recordings.
To scaffold it do:
response_mate setup
ResponseMate's tasks heavily depend on a manifest file where you declare
the requests to be made. The default expected filename of this manifest
is requests.yml
.
The expected format of this file is like this
Example:
base_url: http://localhost:3000/api
default_headers:
accept: 'application/vnd.github.beta+json'
requests:
-
key: user_repos
request: 'GET /user/repos'
-
key: user_issues
request:
path: '/user/issues'
params:
sort: 'updated'
-
key: users_repos
request: 'GET /users/{{some_user_id}}/repos'
Record all the keys of the requests manifest file being requests.yml
response_mate record
response_mate record -k key1 key2
response_mate record -r foo_api.yml
response_mate record -b http://api.foo.com
Remove any existing recordings
response_mate clear
Performs the request and displays the output without recording
response_mate inspect some_key
response_mate inspect -i
Starts a response_mate>
interactive shell that allows you to issue
requests and inspect their output.
Examples:
>response_mate GET google.com
Also you can type history
in the shell to get the history of requests
and replay any of them.
Lists existing recordings
response_mate list
Exports a requests manifest file to a different format (currently only postman is supported)
response_mate export
response_mate export -f postman -p
response_mate export -f postman -r foo_api.yml
response_mate export --resource=environment
response_mate export --resource=environment --upload
Released under the MIT License. See the LICENSE file for further details.