Created
March 10, 2012 10:17
-
-
Save mugyu/2011065 to your computer and use it in GitHub Desktop.
GaucheでhttpファイルをGET
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
(use rfc.http) | |
(use rfc.uri) | |
(define (uri-get uri) | |
(receive (code status body) | |
(receive (scheme user-info hostname port path query frament) | |
(uri-parse uri) | |
(if (eq? path #f) | |
(http-get hostname "/") | |
(http-get hostname path))) | |
body)) | |
(print (uri-get "http://example.com")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment