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

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://776760]
help
Chatterbox?
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: (6)
As of 2015-07-28 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (251 votes), past polls