Mocking HTTP API without Writing Any Code

Install command line HTTP client, httpie.

brew install httpie 

or

npm install httpie

This tool has sensible defaults so it is much easier to use than curl. To make a get request:

http httpie.org

Apiary provides a mock server for paid accounts. We can use Drakov, a mock Server that implements the API Blueprint specification. It is a free tool to run a mock server locally. Install it:

$ npm install -g drakov

Run the mock server:

$ drakov -f clickplan.apib

You can use the httpie as the HTTP client to test the response:

$ http GET http://localhost:3000/products --json

It is easy to use a mock server to play with your RESTful documentation to see how it works.

References


Related Articles


Create your own user feedback survey