Hal Vaughan wrote:
> I've been searching for a module to do this. LWP comes close.
> WWW::Mechanize almost does it, but I can't find one that does just what I
> need.
>
> I have data on my computer that will be transferred to a server by POSTing
> it in an HTTP request (eventually in an HTTPS request, but for now testing
> is on HTTP). I'm having no problem doing this in Java by specifying the
> name/value pairs and POSTing the data, then reading the returned page to
> make sure it was all sent properly. In Perl, though I'm having trouble
> doing it. WWW::Mechanize does forms well, but it requires a pre-existing
> form to have been fetched form the server first, then the fields are filled
> in.
>
> What I need to be able to do is specify name/value pairs (and some values
> are actually files encoded with MIME::Base64), POST them, then read the
> returned HTML page. There is no actual html page I can read with the form
> there and I'd rather not have to make one up, since it's just one more
> thing I'll have to change if the server has any changes done.
>
> What module would be good (and, if possible, easy) to use for this?
>
HTTP::Request::Common may be what you're looking for if I've understood
correctly:
NAME
HTTP::Request::Common - Construct common HTTP::Request objects
SYNOPSIS
use HTTP::Request::Common;
$ua = LWP::UserAgent->new;
...
$ua->request(POST 'http://somewhere/foo', [foo => bar, bar => foo]);
....
HTH,
--
Charles DeRykus
|