This is a HTTP server that's capable of handling simple GET/POST requests, serving files and handling multiple concurrent connections.
The server listens on port 4221.
It accepts requests of types:
GET /
the root responds with200 OK
GET /echo/<a-random-string>
and responds with200 OK <a-random-string>
response.GET /user-agent
and responds with200 OK <User-Agent>
.GET /files/<filename>
and responds anapplication/octet-stream
with the contents of the file as the body if the file exists. Otherwise, it returns a404 Not Found
.POST /files/<filename>
and responds with201 Created
an the file is created with the content of the body of the request.- Any other requests return
404 Not Found