Re: LWP UserAgent form post problem

From: Eric Bohlman (ebohlman_at_earthlink.net)
Date: 05/17/04


Date: 17 May 2004 19:01:47 GMT

wayne_naomi@yahoo.com (Wayne S) wrote in
news:8c8696f2.0405170633.e2d3cb9@posting.google.com:

> I am probably missing something obvious right in front of me, but
> hopefully another point of view will help me. When I paste the
> following link in my browser:
>
> http://www.tad.org/Datasearch/relocation.cfm?StNum=1017&StName=lindstro
> m&Styp=Any+Street+Type

You're using the GET method there (parameters sent as part of the URL).

> I get the data I want. But when I use the following PERL code, the
> server returns no matches:
>
> #!C:\perl\bin\perl.exe -w
> use strict;
> use LWP;
>
> open (OUT, ">tadout.txt");
>
> my $browser = LWP::UserAgent->new();
>
> my $response = $browser->post(
> 'http://www.tad.org/Datasearch/relocation.cfm',
> [
> "StNum" => "1017",
> "StName" => "lindstrom",
> "Styp" => "Any+Street+Type",
> ]
> );

You're using the POST method there (parameters sent as part of the request
body). It's very likely that the server-side process you're trying to
communicate can only handle GET requests.



Relevant Pages

  • Re: LWP UserAgent form post problem
    ... > You're using the POST method there (parameters sent as part of the request ... It's very likely that the server-side process you're trying to ... The search form sent by the server at ...
    (comp.lang.perl.modules)
  • http request using fsockopen
    ... On the start of page B I check var $foo. ... Sending the POST data also though the POST method. ... I manually create a HTTP request to page C and use the fsockopen method to ...
    (php.general)
  • http request using fsockopen
    ... On the start of page B I check var $foo. ... Sending the POST data also though the POST method. ... I manually create a HTTP request to page C and use the fsockopen method to ...
    (alt.php)
  • need help in updating a website using perl script.
    ... I am trying to write a perl script to update a protected bugzilla ... >Code Snippet< ... While trying to process the request: ... But intrestingly when I change the POST method to a GET method I can ...
    (comp.lang.perl.misc)
  • Re: http request using fsockopen
    ... Sending the POST data also though the POST method. ... > I manually create a HTTP request to page C and use the fsockopen method to ... All other PHP scripts in page C is executed as expected though. ...
    (alt.php)