Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Module Suggestions for Posting Form Data

Reply
Thread Tools

Module Suggestions for Posting Form Data

 
 
Hal Vaughan
Guest
Posts: n/a
 
      04-05-2006
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?

Thanks!

Hal
 
Reply With Quote
 
 
 
 
Charles DeRykus
Guest
Posts: n/a
 
      04-05-2006
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any suggestions of doing refreshing data in a web module? lightning Java 2 03-25-2008 03:57 AM
posting to a form with no form name scripteaze@gmail.com Python 3 11-02-2007 08:29 AM
Posting form content to remote servers form? Rob Meade ASP .Net 0 12-01-2004 12:56 PM
Everytime I hover cursro over a posting, it crosses out with red mark on it.. on every posting alanb ASP .Net 2 04-23-2004 02:23 PM
WebClient form Posting with form name? Jeff Baker ASP .Net 2 08-29-2003 12:22 PM



Advertisments