> If it is only the cookie stuff then reading > > man lwpcook > > may help. Remember, that WWW::Mechanize subclasses LWP.
I have created my mech obj as this: my $mech = WWW::Mechanize->new(cookie_jar => {}); This would create an empty cookie jar that can be used to fetch cookie infos. But it is not so convenient when you need also other parameters from the headers, i think it could be easier to build a brand new HTTP::Header with all the needed infos... > Otherwise I am not sure what headers WHICH THE SERVER sends. you should put into a message WHICH then THE CLIENT SENDS. There are not too many occasions > where you would do that... Well, for instance, i need to fetch all the "link" header, that informs the bowser to use a certain css stuff, links etc... Maybe would be necessary to fetch also the cache-control header, the transfer-encoding... What i would like to create is a "fake" login page, with no need of submitting username and password. This could be very useful in a portal enviromnent... -----Messaggio originale----- Da: Robert Barta [mailto:[EMAIL PROTECTED] Per conto di Robert Barta Inviato: giovedì 24 marzo 2005 10.27 A: Andrea Setti Cc: libwww@perl.org Oggetto: Re: R: Strange HTTP::Headers behaviour in WWW::Mechanize->{res}->{_headers} hash On Thu, Mar 24, 2005 at 09:31:08AM +0100, Andrea Setti wrote: > Yes, i know, but i didn't found any API that gets the headers from a > page and forward them to the browser... > > I'm trying to make a single sign-on script, and i need to do the > following > steps: > > 1. fetch the original login page and submit username & password 2. > submit the login page and fetch from the HTTP::Headers all the cookies > that i need to forward to the browser 3. forward to the browser all > the cookies / cache informations / other headers and the content of > the authenticated page. If it is only the cookie stuff then reading man lwpcook may help. Remember, that WWW::Mechanize subclasses LWP. Otherwise I am not sure what headers WHICH THE SERVER sends. you should put into a message WHICH then THE CLIENT SENDS. There are not too many occasions where you would do that... \rho > -----Messaggio originale----- > Da: Robert Barta [mailto:[EMAIL PROTECTED] Per conto di Robert Barta > Inviato: gioved? 24 marzo 2005 03.49 > A: Andrea Setti > Cc: libwww@perl.org; 'John J Lee' > Oggetto: Re: Strange HTTP::Headers behaviour in > WWW::Mechanize->{res}->{_headers} hash > > On Tue, Mar 22, 2005 at 10:41:10AM +0100, Andrea Setti wrote: > > Hi List. > > > > I have an issue to submit to you: > > > > When i loop through WWW::Mechanize->{res}->{_headers} like the > > following > > snippet: > > > > my $headers = $mech->{res}->{_headers}; while ( (my $key, my $value) > > = each (%$headers)) { > > print $key . ': ' . "$value\n";} > > } > > Did you check whether there are actually API calls to do what you need > to do? If I see a component _something in a hash, this usually tells > me to keep my fingers off. > > \rho >