This project aims to create a simple HTTP server using Python. The server processes GET and POST requests from clients, writes or reads request data to a file, and offers an option to block scraping tools like curl.
- GET and POST Support: Handles GET and POST requests from clients.
- File Operations: Writes and reads request data to/from
sunucu_veri.txt
. - HTTP Responses: Generates HTTP responses for valid or invalid request formats.
- Curl Blocking: Provides an option to block client-side scraping.
Ensure Python 3.x is installed. To run the project, follow these steps:
git clone https://github.com/erendrcnn/minimal-http-server
cd sunucu
python sunucu.py
The server runs on localhost
at port 8080 by default.
To start the server:
python sunucu.py
To prevent curl scraping:
python sunucu.py --prevent-scraping
To send a GET request to the server:
curl http://localhost:8080
To send a POST request to the server:
curl -X POST -d "data=example" http://localhost:8080
We welcome contributions. Please submit a pull request or open an issue.
This project is licensed under the MIT License.