The following code is a C HTTP Server written with sockets (sys/sockets.h). The purpose of this project was to relearn C, and learn about how the HTTP protocol works.
Note: This server is extremely simple and just demonstrates the basic concept of how HTTP works.
My goal was to create a simple socket based server that could accept GET and POST requests from curl, and serve an html web page that could be accessed from a browser.
- GET
- Returns a very simple HTML web page
- POST
- Returns a basic summary of the request it got. This includes all headers, and in the case that a file is present, includes a small print out stating how many bytes of the content type it received in the POST request.