It might be that the server is giving a 30x Redirect response? Which
wget automatically follows, but get-pure-port by default does not.

Does it help if you supply a non-zero value like say 10 for the
optional #:redirections argument to get-pure-port?


If it still isn't working, you could try using get-impure-port,
calling purify-port to get the headers, and seeing what they say.



On Thu, Sep 10, 2015 at 4:46 PM, R. Clayton <rvclay...@acm.org> wrote:
> I'm trying to download a page using get-pure-port and I'm not getting the
> result I expected:
>
>   $ cat d.rkt
>   #lang racket
>
>   (require net/url)
>
>   (define library-url (string->url
>     "http://example.com/search?/ftlist^bib18%2C1%2C0%2C2703/mode=2";))
>
>   (call/input-url
>     library-url
>     get-pure-port
>     port->string)
>
>   $ mzscheme --eval '(require "d.rkt")' > r.html
>
>   $ wget -O w.html --quiet 
> "http://example.com/search?/ftlist^bib18%2C1%2C0%2C2703/mode=2";
>
>   $ wc -lc [wr].html
>        1   5618 r.html
>     3353 116900 w.html
>     3354 122518 total
>
>   $ mzscheme --version
>   Welcome to Racket v6.2.
>
>   $
>
> And no, example.com is not the hostname I used.  The fields in library-url 
> seem
> reasonable when compared to the url string.  Why is there a difference
> between the results of get-pure-port and wget?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to