Last active
October 19, 2015 16:18
-
-
Save trane/99ef215be7f3a69e69e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # the Request protocol is simple: | |
| # | |
| # [Method] [Path] [Version] | |
| # Host: [Hostname] | |
| # <new line> | |
| # [Body] | |
| # <new lines> | |
| # | |
| # here is an example of GET (which has an empty body, because GET usually means retrieve something from the server): | |
| GET / HTTP/1.1 | |
| Host: localhost | |
| # here is an example of POST (which has a non-empty body, because POST usually means "add/modify" something on the server): | |
| POST / HTTP/1.1 | |
| Host: localhost | |
| hello=Hello&world=World | |
| # this will start up a simple http server on localhost (your computer) | |
| # try this on the command line, using python3 | |
| $ python -m http.server 8000 | |
| # connect to it | |
| $ telnet localhost 8000 | |
| # type the following, and hit your enter/return key | |
| GET / HTTP/1.1 | |
| Host: localhost |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment