I just pushed a fix for these issues. Thank you!
Jay
On Fri, Oct 16, 2015 at 12:17 PM, Greg Hendershott
wrote:
> The URL needs to get split into parts, and the HTTP request will go
> "on the wire" as something like:
>
> HEAD HTTP/1.0
> Host: www.racket-lang.org
>
>
> When you have
Thanks Greg. Here's a variation that gives a little more insight.
#lang racket
(require net/url)
(with-handlers ([(lambda (x) #t)
(lambda (x) (printf "Oops!"))])
(purify-port (head-impure-port (string->url
"http://www.racket-lang.org";))) )
I repeatedly run this. In all
The URL needs to get split into parts, and the HTTP request will go
"on the wire" as something like:
HEAD HTTP/1.0
Host: www.racket-lang.org
When you have the trailing / it will be:
HEAD / HTTP/1.0
Which makes sense.
When the trailing slash is missing, i.e. "no path", I'm gue
This works:
> (define p (head-impure-port (string->url "http://www.racket-lang.org/";)))
> (read-line p)
"HTTP/1.1 200 OK\r"
But, leaving off trailing /, I usually see
> (define p (head-impure-port (string->url "http://www.racket-lang.org";)))
string-trim: contract violation
expected: string
4 matches
Mail list logo