Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: HTTP GET without LWP

by sutch (Curate)
on Jan 13, 2001 at 04:34 UTC ( [id://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 http://login.gatorlink.ufl.edu/authenticate.cgi in a browser and notice that you are redirected to http://login.gatorlink.ufl.edu/retry.cgi? .

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 login.gatorlink.ufl.edu 80 Trying 128.227.128.87... Connected to dir2fe1.server.ufl.edu. Escape character is '^]'. GET /authenticate.cgi HTTP/1.1 Host: login.gatorlink.ufl.edu 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=/; domain=.ufl.edu; 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

Replies are listed 'Best First'.
Re: Re: HTTP GET without LWP
by isotope (Deacon) 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.

    --isotope
    http://www.skylab.org/~isotope/

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-20 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found