On Thu, 30 Dec 2004, Denzil Kruse wrote:

> I tried that, but it didn't matter much.  What happens is I have a 
> link.  When I click on it, the browser hangs.  If I switch to another 
> application on my desktop whose window covers the browser, and then I 
> switch back to the browser, the graphics of the browser is not 
> redrawn.  I use IE, and the windows logo isn't spinning and and green 
> progress bar is going nowhere.

When I have a situation like this, I leave the web browser and start 
debugging via other means. 

Two options that come to mind are lynx and telnet. lynx is a text-mode 
web browser that is available for Windows via Cygwin; you run it in a 
DOS window. lynx has a very useful '-mime_header' command line option 
that outputs the full, raw results of a request to the console. For 
example, here's what a request to Google.com looks like:

    $ lynx -mime_header http://google.com/
    HTTP/1.0 302 Found
    Location: http://www.google.com/
    Set-Cookie: 
PREF=ID=02bcd50c22028675:TM=1104438517:LM=1104438517:S=RDEtbY9uEaUVr5ze; 
expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com
    Content-Type: text/html
    Server: GWS/2.1
    Content-Length: 152
    Date: Thu, 30 Dec 2004 20:28:37 GMT
    Connection: Keep-Alive

    <HTML><HEAD><TITLE>302 Moved</TITLE></HEAD><BODY>
    <H1>302 Moved</H1>
    The document has moved
    <A HREF="http://www.google.com/";>here</A>.
    </BODY></HTML>
    $

For testing your own site, you can do the same thing:

    $ lynx -mime_header "http://mysite/cgi-bin/test.pl?a=1&b=2";

It's also possible to manually interact with the remote web server by 
opening up a telnet sesstion to the web port. Here's an example; the 
lines where I type things are prefixed with a '->' marker:

 -> $ telnet www.google.com 80
    Trying 64.233.187.99...
    Connected to www.google.com.
    Escape character is '^]'.
 -> HEAD / HTTP/1.0
 ->
    HTTP/1.0 200 OK
    Cache-Control: private
    Content-Type: text/html
    Set-Cookie: 
PREF=ID=38c23118a0763701:TM=1104438717:LM=1104438717:S=goAOAnKfb7EPl0ha; 
expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com
    Server: GWS/2.1
    Content-Length: 0
    Date: Thu, 30 Dec 2004 20:31:57 GMT
    Connection: Keep-Alive

    Connection closed by foreign host.
    $

This can be useful, but it means you have to know how to "speak" HTTP to 
a web server -- not that that's very hard, as there's only half a dozen 
words or so in the whole HTTP "language", and the only ones you'd care 
about in most cases are GET, POST, and HEAD. 

But if you want to skip that, just use `lynx -mime_headers $URL`, or an 
equivalent such as the command line tools that are installed [on Unix 
systems] with Bundle::LWP from CPAN. In this way, you should be able to 
see pretty clearly where things are breaking down, and you won't be 
distracted by what the browser is doing in the background, because it 
won't *be* in the background.



-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to