Skip to content

ben-dh3/http_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HTTP Server Made Using Python

Server made using this tutorial as guidance, with added POST request functionality.

Made for the purpose of understanding the HTTP protocol, the HTTP server is built on a TCP server made using Python's socket library.

Wrote an article explaining HTTP and TCP and how this server works.

How to Run the Project

Make a GET request

  • In your terminal, navigate outside the main.py file and run:

python main.py

  • Visit localhost and append the html file name you want to visit:

http://127.0.0.1:8888/index.html

Make a POST request to one of the HTML pages and change the contents of the document.

  • First run the server

python main.py

  • Then make a POST request using curl

curl -v -X POST http://localhost:8888/index.html

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors