Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: IO::Socket, Multiple GET.

by jhourcle (Prior)
on Jul 02, 2009 at 14:26 UTC ( #776760=note: print w/ replies, xml ) Need Help??

in reply to IO::Socket, Multiple GET.

$msg = "GET /engine3.php?req_sale=5205&page=1\r\n";

You're sending HTTP/0.9, which doesn't have provisions for persistent connections, and the server will always disconnect you. You need to either send an HTTP/1.1 request, or HTTP/1.0 with the appropriate headers ... and for that, I'd do as poolpi and our anonymous friend have already mentioned, and use LWP::UserAgent (search the instructions for 'keep_alive' ).

Comment on Re: IO::Socket, Multiple GET.
Replies are listed 'Best First'.
Re^2: IO::Socket, Multiple GET.
by ikegami (Pope) on Jul 02, 2009 at 16:58 UTC

    You need to either send an HTTP/1.1 request, or HTTP/1.0 with the appropriate headers

    • HTTP/1.1 does not automatically keep the connection open. An appropriate Keep-Alive header must be sent.

    • Keep-Alive was introduced in HTTP/1.1. HTTP/1.0 does not support keeping the connection open.

      However, since Keep-Alive is compatible with HTTP/1.0, many servers that claim to be HTTP/1.0 support Keep-Alive. This was the cases even when HTTP/1.1 was still a draft.

    • Finally, servers are under no requirement to honour Keep-Alive requests.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2016-02-11 14:07 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (371 votes), past polls