Skip to content

This repository contains a Python program with basic HTTP server functionality. It handles file uploads, data processing, and request handling for simple HTTP server tasks. The server processes POST and GET requests from browsers or API clients and runs on localhost by default with a simple file writing/reading mechanism.

License

Notifications You must be signed in to change notification settings

erendrcnn/minimal-http-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Minimalist Python HTTP Server

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.

Features

  • 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.

Installation

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

Usage

The server runs on localhost at port 8080 by default.

Start the Server

To start the server:

python sunucu.py

To prevent curl scraping:

python sunucu.py --prevent-scraping

Send Requests

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

Contributing

We welcome contributions. Please submit a pull request or open an issue.

License

This project is licensed under the MIT License.

About

This repository contains a Python program with basic HTTP server functionality. It handles file uploads, data processing, and request handling for simple HTTP server tasks. The server processes POST and GET requests from browsers or API clients and runs on localhost by default with a simple file writing/reading mechanism.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages