Re: Module Suggestions for Posting Form Data



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



.



Relevant Pages

  • Module Suggestions for Posting Form Data
    ... 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, ... I'm having no problem doing this in Java by specifying the ... returned HTML page. ...
    (comp.lang.perl.misc)
  • Re: Remote Data Access Connection Testing
    ... Leave Internetuser and Password as an Empty string (e.g.... ... Used my internal IP address of my desktop machine / IIS Server / SQL Server ... I typically would like to use a WiFi connection to access ... >> 3)Are you specifying the server by machine name or IP address, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Gotta start somewhere ... how many of us are really out there?
    ... The last 4 hex digits of the card and chip lines are the vendor ID ... to any server -- this can all be resolved at the server end, ... but that might be a bit heavy to do in an HTTP request, ...
    (freebsd-questions)
  • [NT] Sun ONE (iPlanet) Application Server Connector Module Overflow
    ... Sun ONE Application Server. ... Incoming HTTP request URLs are handled by the module ... The vendor was initially contacted via email on 5/22/2002. ...
    (Securiteam)
  • [Full-disclosure] MDKSA-2005:130 - Updated apache packages fix vulnerabilities
    ... Watchfire reported a flaw that occured when using the Apache server as ... A remote attacker could send an HTTP request with both a ... GPG public key of the Mandriva Security Team by executing: ...
    (Full-Disclosure)