by tomashanacek

tomashanacek / mock-server

Simple mock server for REST API

216 Stars 81 Forks Last release: Not found Other 88 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Mock server

Simple mock server for REST and XML-RPC API

It can mock GET, POST, PUT, PATCH, DELETE and some more rarely used HTTP methods.

Build status at

Travis CI 
_: |travis|

.. |travis| image:: :target:



Install with pip::

$ pip install mock-server

Or install with easy_install::

$ easy_install mock-server

And after run::

$ mock-server --dir=/path/to/api

It will be listening on port 8888 and wait for your HTTP requests.


| For create mock for url path go to: | | http://localhost:8888/__manage/create |

Mocked GET /user/tom::

$ curl -v -X GET

> GET /user/tom HTTP/1.1 > Host: > Accept: / > < HTTP/1.1 200 OK < Access-Control-Allow-Origin: * < Content-Type: application/json; charset=utf-8 < Content-Length: 64 < Server: TornadoServer/2.4.1 < { "name": "Tom", "surname": "Smith", "age": 22 }


  • Mocking REST API.
  • Mocking RPC API (xml, json).
  • Upstream server proxy (proxy an existing api).
  • Variables in url path.
  • Simple api documentation (markdown).
  • Api authentication (HTTP Basic authentication).

Release new version


response content format:


response headers format:



    GET_200.json         # response content for GET /
    GET_H_200.json       # headers for GET /
        DELETE_404.xml   # response content for DELETE /user.xml?__statusCode=404
        POST_200.json    # response content for POST /user
        POST_H_200.json  # headers for POST /user

Bug report

If you have any trouble, report bug at GitHub Issue


William Zhang

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.