Technical requirements
Before we start coding our web server, let us list some fundamental characteristics that must be met by our software:
- Support for
GETandPOSTmethods only - Support for submitting HTML content (pages)
- Support for receiving URL parameters (query params) and request body
- Support for sending content in plain text (TXT files)
- Support for sending images in the following formats:
- JPG/JPEG
- PNG
- Handling of successful requests (200 OK response code)
- Handling requests where the resource is not found (404 NOT FOUND), as well as generating a standard response page
- For any other types of handling errors, generate a 500 INTERNAL SERVER ERROR response code and a standardized page showing the error
In this way, we can generate an understanding of the functioning of requests and HTTP protocol responses.