http://www.perlmonks.org?node_id=106373

ThingFish has asked for the wisdom of the Perl Monks concerning the following question:

I would like to GET the contents of an HTTP_REFERER protected form, post needed information back to cgi that said script uses, and view the output of that script in my browser. I cant seem to figure how to do the posting on this protected form/script. Any ideas?

Originally posted as a Categorized Question.

  • Comment on GET and POST HTTP_REFERER protected form?

Replies are listed 'Best First'.
Re: GET and POST HTTP_REFERER protected form?
by chipmunk (Parson) on Aug 21, 2001 at 01:41 UTC
    If you're using LWP::UserAgent and HTTP::Request, you can specify the HTTP_REFERER using HTTP::Request's header() method:
    # set up the user agent... $req = HTTP::Request->new(GET => 'http://www.example.com'); $req->header('Referer' => 'http://www.yahoo.com'); # make the request and so on...
Re: GET and POST HTTP_REFERER protected form?
by Amoe (Friar) on Aug 29, 2001 at 23:04 UTC
    As a side note, as well as that method, you can also use:
    $req->referer('http://www.yahoo.com');