Created
August 20, 2013 01:39
-
-
Save nickpresta/6276195 to your computer and use it in GitHub Desktop.
This file contains 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
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
func handler(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintf(w, "Method: %s\n", r.Method) | |
} | |
func main() { | |
http.HandleFunc("/", handler) | |
http.ListenAndServe(":8080", nil) | |
} |
This file contains 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
$ telnet 127.0.0.1 8080 | |
Trying 127.0.0.1... | |
Connected to localhost. | |
Escape character is '^]'. | |
GEM / HTTP/1.1 | |
Host: example.org | |
HTTP/1.1 200 OK | |
Content-Type: text/plain; charset=utf-8 | |
Content-Length: 12 | |
Date: Tue, 20 Aug 2013 01:37:33 GMT | |
Method: GEM | |
LINK / HTTP/1.1 | |
HTTP/1.1 200 OK | |
Content-Type: text/plain; charset=utf-8 | |
Content-Length: 13 | |
Date: Tue, 20 Aug 2013 01:37:48 GMT | |
Method: LINK | |
PUN / HTTP/1.1 | |
Host: example.org | |
HTTP/1.1 200 OK | |
Content-Type: text/plain; charset=utf-8 | |
Content-Length: 12 | |
Date: Tue, 20 Aug 2013 01:37:57 GMT | |
Method: PUN | |
POSH / HTTP/1.1 | |
HTTP/1.1 200 OK | |
Content-Type: text/plain; charset=utf-8 | |
Content-Length: 13 | |
Date: Tue, 20 Aug 2013 01:38:04 GMT | |
Method: POSH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment