Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: HTTP Post read response , Post again

by poolpi (Hermit)
on Dec 19, 2008 at 14:41 UTC ( [id://731556]=note: print w/replies, xml ) Need Help??


in reply to HTTP Post read response , Post again

Due to this I am unable to retrive file with second post.

I think you're trying to access a protected file,
you may try something like this:

( See lwpcook )

#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => 'http://someip:port/'); $req->authorization_basic('Username', 'password'); print $ua->request($req)->as_string;


hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb

Replies are listed 'Best First'.
Re^2: HTTP Post read response , Post again
by perljunkie (Initiate) on Dec 19, 2008 at 15:28 UTC
    No login is no issue, because when i enter no password I receive negative response. When both userid and password correct I see login successful message sent by server.
      You can disable "TE" header sending by tweaking LWP::Protocol::http properties. Add the following to your code and TE will not sent.
      push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, SendTE => 0);
      Regards,

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-16 19:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found