HTTP::Request::Common Post problem

M

matlaw

I'm trying to Post to a web site using the following code:
#!/usr/bin/perl
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
my $req = POST 'http://www.sfarmls.com/scripts/mgrqispi.dll',
[ APPNAME => 'Sanfrancisco',
PRGNAME => 'MLSLogin',
ARGUMENTS => ('-ASS','-AA'),
];
print $ua->request($req)->as_string;

But when I do, I get an HTML file from www.sfarmls.com telling me that
I'm using an invalid entry point.

However, I can easily access this site with the following telnet
commands:
POST /scripts/mgrqispi.dll HTTP/1.1
Host: www.sfarmls.com
Content-Length: 56
Content-Type: application/x-www-form-urlencoded
APPNAME=Sanfrancisco&PRGNAME=MLSLogin&ARGUMENTS=-ASS,-AA

Can anyone tell me what I'm doing wrong?

Thanks,

Matt
 
Z

zentara

I'm trying to Post to a web site using the following code:
#!/usr/bin/perl
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
my $req = POST 'http://www.sfarmls.com/scripts/mgrqispi.dll',
[ APPNAME => 'Sanfrancisco',
PRGNAME => 'MLSLogin',
ARGUMENTS => ('-ASS','-AA'),
];
print $ua->request($req)->as_string;

But when I do, I get an HTML file from www.sfarmls.com telling me that
I'm using an invalid entry point.

However, I can easily access this site with the following telnet
commands:
POST /scripts/mgrqispi.dll HTTP/1.1
Host: www.sfarmls.com
Content-Length: 56
Content-Type: application/x-www-form-urlencoded
APPNAME=Sanfrancisco&PRGNAME=MLSLogin&ARGUMENTS=-ASS,-AA

Can anyone tell me what I'm doing wrong?

Have you tried capturing the transfers with something like ethereal or
tcpick, and seeing what is actually being sent?

Just glancing at syntax, I zeroed in on

ARGUMENTS => ('-ASS','-AA'),
vs.
&ARGUMENTS=-ASS,-AA

as looking quite susceptible to different interpretations.

maybe try
ARGUMENTS => ['-ASS','-AA'],
or
ARGUMENTS => '-ASS, -AA',

? just guessing :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top