mock-server is a simple, universal and self-contained python HTTP server.

It is very simple to use. No fancy configuration or options. Everything has a default value.

It is universal because you don't have to configure paths. It will just respond to any URL for any request method, so you only need to change the response you want, not the mock.

It is a single self-contained python script. No need to install or anything complicated. Just execute it.


To serve on port 80, with return status 200 and message 'ok':


To serve an empty JSON:

$ -d"{}"

To serve a JSON, XML or any text message

$ -f response.txt

To change the response status:

$ -s 500

To choose a server name and port:

$ -n myserver -p 8080

For help: $ -h

More information

For more information, new versions or bug reporting try the project page.