Try this:
(require net/url)
(define input (get-pure-port (string->url "http://www.someurl.com")))
(define response (port->string input))
(close-input-port input)
Now the response
variable will contain the http response from the server. Even better, pack the above in a procedure, also notice that I added a maximum number of redirections allowed:
(define (urlopen url)
(let* ((input (get-pure-port (string->url url) #:redirections 5))
(response (port->string input)))
(close-input-port input)
response))
(urlopen "http://www.someurl.com") ; this will return the response
EDIT:
Following @GregHendershott's excellent advice (see his answer for details), here's another, more robust way to implement the desired functionality:
(define (urlopen url)
(call/input-url
(string->url url)
(curry get-pure-port #:redirections 5)
port->string))