develooper Front page | perl.libwww | Postings from January 2001

LWP call

From:
Tac/Smokescreen Action Network
Date:
January 9, 2001 13:37
Subject:
LWP call
Message ID:
06d501c07a84$7dcfdc60$103a08d1@smokescreen.org
I'm creating a module to parse out XML into and LWP call, and am having a
difficult time understanding the request object for POST.  For GET, it's
easier, since the URL just needs to get the query vars.

For example, I have the following

<QUERY URL="somedomain.com/enterdata.pl" METHOD="POST">
   <COOKIE NAME="SessionID" Value="9284294">
   <COOKIE NAME="UserID" Value="A22">
   <FORMVARS>
  <VAR NAME="Firstname" VALUE="Michael">
  <VAR NAME="Collection" VALUE="144"> <!-- these come from a
  <VAR NAME="Collection" VALUE="214">
  <!-- more vars that I don't know ahead of time -->
  </FORMVARS>
</QUERY>

As I mentioned before, when this is a GET, I can add the formvars to $u and
use

my $req = HTTP::Request->new('GET', $u);
$req->header('Cookie' => $cookie_header);

My question is, how do I add formvars to a POST request?  Create a hash with
them in it, and then...?

TIA,

Tac






nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About