Created
April 6, 2009 19:18
-
-
Save emk/90885 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
;; Insert somewhere in test/scripts/features.ss to test. | |
(card /features/http (%standard-test-card% :title "HTTP") | |
(edit-box result | |
((inset-rect $screen-rect 50) | |
"" | |
:multiline? #t | |
:font-size 12)) | |
(run | |
(with-values [[tcp-in tcp-out] | |
(tcp-connect "iml.dartmouth.edu" 80)] | |
(fprintf tcp-out "GET /halyard/ HTTP/1.1\r\nHost: iml.dartmouth.edu\r\n\r\n") | |
(close-output-port tcp-out) | |
(let loop [[line (read-line tcp-in 'return-linefeed)]] | |
(unless (eof-object? line) | |
(set! (.result.text) (string-append (.result.text) line "\n")) | |
(loop (read-line tcp-in 'return-linefeed))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment