A simple HTTP echo server implemented in Python using the built-in http.server
module.
- Handles GET and POST requests
- Returns request path and headers for GET requests
- Echoes back POST data
- Runs on port 4000 by default
-
Start the server:
python3 echo_server.py
-
Test with curl:
# GET request curl http://localhost:4000/test # POST request curl -X POST -d "Hello World" http://localhost:4000/
- Python 3.x
MIT