in reply to Re: HTTP Post read response , Post again
in thread HTTP Post read response , Post again

thanks for your reply. I modified my code to have keep-alive. Below is output. It still send Connection as TE, Close. However I see Keepalive message send but ignored.
POST / HTTP/1.1 TE: deflate,gzip;q=0.3 Connection: TE, close Host: someip:port User-Agent: Perlprogram/0.1 Content-Length: 218 Content-Type: application/text Keep-Alive: 1

Replies are listed 'Best First'.
Re^3: HTTP Post read response , Post again
by zwon (Abbot) on Dec 20, 2008 at 22:42 UTC
    Probably something wrong in your code, I've tested following script:
    use strict; use warnings; use LWP::UserAgent; use HTTP::Request::Common; my $message; my $userAgent = LWP::UserAgent->new( agent => 'Perlprogram/0.1', keep_alive => 1 ); $message = "UserID: Username, Password: password"; my $response = $userAgent->request( POST 'http://example.com/', Content_Type => 'application/text', Content => $message );
    And here is the request I've got:
    POST / HTTP/1.1 TE: deflate,gzip;q=0.3 Keep-Alive: 300 Connection: Keep-Alive, TE Host: example.com User-Agent: Perlprogram/0.1 Content-Length: 36 Content-Type: application/text UserID: Username, Password: password