Skip to content

Simple HTTP server that logs information about requests received - useful for testing applications that send HTTP requests to external systems.

License

Notifications You must be signed in to change notification settings

ceccon-t/catcher-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Catcher Server

Minimal server that accepts any request to any endpoint and logs the HTTP method/verb, endpoint and body payload received.

The server always responds with a 200 OK response, and logs to the console the information about the request.

Quick start

0. Clone this repository

Navigate to the folder you wish to have the repo on.

Clone it:

git clone git@github.com:ceccon-t/catcher-server.git

Enter the cloned folder:

cd catcher-server

1. Create and activate a virtual environment (optional, but strongly recommended)

Create virtual environment:

python3 -m venv env

Activate it:

source env/bin/activate

2. Install dependencies

pip install -r requirements.txt

3. Run the server

Using the default port (9999):

python server.py

Optionally, you can use a custom port:

PORT=8000 python server.py

Examples

Simple GET request:

curl "http://localhost:9999/some/endpoint?a=b"

POST with a payload:

curl -X POST "http://localhost:9999/api/v1/something?id=1" \
    -H "Content-Type: application/json" \
    -d '{"hello": "world"}'

Usage

See LICENSE.

You are free to use this project without paying me anything.

But, if you do, you are morally obliged to go read The Catcher In The Rye.

About

Simple HTTP server that logs information about requests received - useful for testing applications that send HTTP requests to external systems.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages