/response_mate

Cli tool to make inspecting and recording HTTP requests fun again

Primary LanguageRubyMIT LicenseMIT

ResponseMate

Gem version Code Climate Dependencies tatus Coverage Status

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

Install

gem install response_mate

Usage

For a list of available commands run response_mate help For help on a command run response_mate help some_command

Setup

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

Default

Record all the keys of the requests manifest file being requests.yml

response_mate record

Specific key(s)

response_mate record -k key1 key2

Specify a different request manifest

response_mate record -r foo_api.yml

Specify a different base url for the requests

response_mate record -b http://api.foo.com

Clear

Remove any existing recordings

response_mate clear

Inspect

Performs the request and displays the output without recording

response_mate inspect some_key

Interactive mode

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.

List

Lists existing recordings

response_mate list

Export

Exports a requests manifest file to a different format (currently only postman is supported)

response_mate export

Export in pretty json

response_mate export -f postman -p

Specify a different request manifest

response_mate export -f postman -r foo_api.yml

Export the environment.yml

response_mate export --resource=environment

Upload the exported and get a link

response_mate export --resource=environment --upload

List of contributors

Licence

Released under the MIT License. See the LICENSE file for further details.

Bitdeli Badge