Simple web server for handling concurrent connections and serving requests written in Python with only standard libraries.
./run.sh
Start the web server listening for requests on port 4221
.
-
$ curl -v http://localhost:4221/echo/abc
HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 3\r\n\r\nabc
-
$ curl -i http://localhost:4221/files/foo
HTTP/1.1 200 OK\r\nContent-Type: application/octet-stream\r\nContent-Length: 14\r\n\r\nHello, World!
HTTP/1.1 404 Not Found\r\n\r\n
-
$ curl -v --data "12345" -H "Content-Type: application/octet-stream" http://localhost:4221/files/file_123
HTTP/1.1 201 Created\r\n\r\n