Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Unable to access restricted URL resource (GET) 302 redirect msg - using HTTP::Request::Generator

by tobyink (Canon)
on Oct 10, 2020 at 20:53 UTC ( [id://11122674]=note: print w/replies, xml ) Need Help??


in reply to Unable to access restricted URL resource (GET) 302 redirect msg - using HTTP::Request::Generator

As per my comment on StackOverflow, this:

wrap => sub { my ( $req ) = @_; # $req->{headers}->{'TE'} = 'ASAD'; return $req; }, wrap => \&HTTP::Request::Generator::as_http_request,

Does not work. The wrap option can only be given once. The second wrapper (\&HTTP::Request::Generator::as_http_request) overrides the first one (sub {...}) and the first one is completely being ignored so it doesn't need to be there.

I'm not sure why you're using HTTP::Request::Generator at all. LWP::UserAgent (perhaps with a cookie jar) seems like it should do all you need.

  • Comment on Re: Unable to access restricted URL resource (GET) 302 redirect msg - using HTTP::Request::Generator
  • Select or Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-19 17:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found