Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: HTTP GET without LWP

by sutch (Curate)
on Jan 13, 2001 at 04:34 UTC ( #51522=note: print w/ replies, xml ) Need Help??

in reply to HTTP GET without LWP

update: because of isotope's response to this posting, I've discovered that it is not HTTP/1.1 that is the solution, but providing the Host: header that allows the server to respond with a redirect. Without LWP, you're safer and have less work if you stick to HTTP/1.0 combinded with the Host: header

The page is not available, for whatever reason (probably because of authentication). Request in a browser and notice that you are redirected to .

You're making an HTTP request using HTTP/1.0. So the server responds with the "404 Not Found" page. Change your request to HTTP/1.1 and you will receive a redirect as the response:

telnet 80 Trying Connected to Escape character is '^]'. GET /authenticate.cgi HTTP/1.1 Host: HTTP/1.1 302 Found Date: Fri, 12 Jan 2001 23:30:14 GMT Server: Apache/1.3.6 (Unix) mod_perl/1.19 mod_ssl/2.2.8 OpenSSL/0.9.2b URI: retry.cgi? Set-Cookie: UF_GatorLinkState=none; path=/;; Location: retry.cgi? Transfer-Encoding: chunked Content-Type: text/html be <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD> <TITLE>302 Found</TITLE> </HEAD><BODY> <H1>Found</H1> The document has moved <A HREF="retry.cgi?">here</A>.<P> </BODY></HTML> 0

Comment on Re: HTTP GET without LWP
Download Code
Replies are listed 'Best First'.
Re: Re: HTTP GET without LWP
by isotope (Chaplain) on Jan 13, 2001 at 04:49 UTC
    Don't send HTTP/1.1 unless you're prepared to implement it properly. If you do, the server will expect to keep the connection open. The Host: header is supported just fine with HTTP/1.0, which will drop the connection as soon as the transfer is complete.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://51522]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2015-12-01 20:46 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (26 votes), past polls