in reply to Using HTTP::Request::Common to do a GET with form-data?

Wonko the sane : - I tried your command against google's website but does not work. Here is the command I used -
perl -MLWP::Simple -ne 'getprint("http://www.google.com /search?hl=en&ie=UTF-8&oe=UTF8&q=test")'
. The response was 403 Forbidden. What's wrong with this query ?

Replies are listed 'Best First'.
Re: Re: Using HTTP::Request::Common to do a GET with form-data?
by dingus (Friar) on Nov 19, 2002 at 17:59 UTC
    I tried your command against google's website ...
    ...The response was 403 Forbidden. What's wrong with this query ?

    Whats wrong is the google doesn't like the LWP User Agent and will always return 403 to any request with the LWP UA. See this email thread (which I found from a google search). You need to set the UA to something like 'Mozilla/3.142', which I don't believe is possible using LSP::Simple. See doco on LWP and LWP::UserAgent

    Dingus


    Enter any 47-digit prime number to continue.
Re: Re: Using HTTP::Request::Common to do a GET with form-data?
by dingus (Friar) on Nov 19, 2002 at 18:00 UTC
    I tried your command against google's website ...
    ...The response was 403 Forbidden. What's wrong with this query ?

    Whats wrong is the google doesn't like the LWP User Agent and will always return 403 to any request with the LWP UA. See this email thread (which I found from a google search). You need to set the UA to something like 'Mozilla/3.142', which I don't believe is possible using LWP::Simple. See doco on LWP and LWP::UserAgent

    Dingus


    Enter any 47-digit prime number to continue.
      Dingus => I was just using google.com as an example of my test. I am trying to locate any sample script that uses method GET for submitting a form using the HTTP::Request::Common method.
      Thanks