Last active
December 17, 2015 08:19
-
-
Save grauwoelfchen/5579295 to your computer and use it in GitHub Desktop.
Hello Racket ;)
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
(require racket/tcp) | |
(let-values ([(inp outp) (tcp-connect "racket-lang.org" 80)]) | |
(display "GET / HTTP/1.0\n\n" outp) | |
(close-output-port outp) | |
(let ([o (open-output-string)]) | |
(let aux ([r (read inp)]) | |
(if (eof-object? r) | |
(display (get-output-string o)) | |
(begin (display r o) | |
(aux (read inp)))))) | |
(close-input-port inp)) |
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
HTTP/1.1302FoundDate:Tue(unquote 14)May201320:29:17GMTServer:Apache/2.2.15(Fedora)Location:http://racket-lang.org/Vary:Accept-EncodingContent-Length:294Connection:closeContent-Type:text/html<!DOCTYPEHTMLPUBLIC-//IETF//DTD HTML 2.0//EN><html><head><title>302Found</title></head><body><h1>Found</h1><p>Thedocumenthasmoved<ahref=http://racket-lang.org/>here</a>.</p><hr><address>Apache/2.2.15(Fedora)Serveratchamplain.ccs.neu.eduPort80</address></body></html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment