|
Posted by Sure on September 1, 2004, 4:09 am
Please log in for more thread options
Hello All,
I want to update a form using the LWP & HTTP method. It was
working fine when I am updating the values like this
$ua = LWP::UserAgent->new;
$url
='http://xxx.be/cgi-bin/viewauth/Tracking/TestProjectAgainInitialDevStory#edittable2';
use HTTP::Request::Common;
my $res = $ua->request(POST $url,
Content_Type =>'form-data',
Content => [
ettablenr => '2',
etcell2x1 =>'Task',
etcell2x2 =>'2',
etcell2x3 =>'3',
etcell2x4 =>'4',
etcell2x5 =>'High',
etcell2x6 =>'SureshC',
etcell2x7 =>'CSuresh',
etcell2x8 =>'Twiki Data Updation',
etrows => '2',
etsave =>'Save table']);
It was not working when I store the value into a Variable. Like This.
$postStr = ettablenr => '2', etcell2x1 =>'Task', etcell2x2 =>'2',
etcell2x3 =>'3', etcell2x4 =>'4', etcell2x5 =>'High', etcell2x6
=>'SureshC', etcell2x7 =>'CSuresh', etcell2x8 =>'Twiki Data
Updation', etrows => '2', etsave =>'Save table']);
$ua = LWP::UserAgent->new;
my $res = $ua->request(POST $url, Content_Type=>'form-data', Content
=>[$postStr]);
Can any one pls let me know what is the problem when i doing like
this.
Thanks in Advance
|
|
Posted by Gunnar Hjalmarsson on September 1, 2004, 1:43 pm
Please log in for more thread options
Sure wrote:
> It was not working when I store the value into a Variable. Like
> This.
>
> $postStr = ettablenr => '2', etcell2x1 =>'Task', etcell2x2
> =>'2', etcell2x3 =>'3', etcell2x4 =>'4', etcell2x5 =>'High',
> etcell2x6 =>'SureshC', etcell2x7 =>'CSuresh', etcell2x8 =>'Twiki
> Data Updation', etrows => '2', etsave =>'Save table']);
>
> $ua = LWP::UserAgent->new;
> my $res = $ua->request(POST $url, Content_Type=>'form-data',
> Content =>[$postStr]);
------------^--------^
Assuming $postStr is an array reference:
my $postStr = [ ettablenr => '2', ... etsave =>'Save table' ];
this should work:
my $res = $ua->request(POST $url,
Content_Type =>'form-data',
Content => $postStr);
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
|
|
Posted by Charles DeRykus on September 11, 2004, 7:19 am
Please log in for more thread options >Hello All,
>I want to update a form using the LWP & HTTP method. It was
>working fine when I am updating the values like this
>
>$ua = LWP::UserAgent->new;
>$url
='http://xxx.be/cgi-bin/viewauth/Tracking/TestProjectAgainInitialDevStory#edittable2';
>use HTTP::Request::Common;
>
>my $res = $ua->request(POST $url,
> Content_Type =>'form-data',
> Content => [
> ettablenr => '2',
> etcell2x1 =>'Task',
> etcell2x2 =>'2',
> etcell2x3 =>'3',
> etcell2x4 =>'4',
> etcell2x5 =>'High',
> etcell2x6 =>'SureshC',
> etcell2x7 =>'CSuresh',
> etcell2x8 =>'Twiki Data Updation',
> etrows => '2',
> etsave =>'Save table']);
>
>
>It was not working when I store the value into a Variable. Like This.
>
>$postStr = ettablenr => '2', etcell2x1 =>'Task', etcell2x2 =>'2',
>etcell2x3 =>'3', etcell2x4 =>'4', etcell2x5 =>'High', etcell2x6
>=>'SureshC', etcell2x7 =>'CSuresh', etcell2x8 =>'Twiki Data
>Updation', etrows => '2', etsave =>'Save table']);
>
The above statement won't compile...
>$ua = LWP::UserAgent->new;
>my $res = $ua->request(POST $url, Content_Type=>'form-data', Content
>=>[$postStr]);
>
--
Charles DeRykus
|
| Similar Threads | Posted | | CGI - POST - newbie | August 27, 2004, 9:45 am |
| AuthCookieNTLM - No Post Data | December 6, 2004, 9:25 am |
| AuthCookieNTLM - No Post Data | December 6, 2004, 10:01 am |
| login to National Post using LWP | January 4, 2006, 11:30 pm |
| Help regarding HTTP::Request:POST | February 24, 2006, 11:31 pm |
| libwww-SSL Post Issue | August 2, 2006, 4:04 pm |
| mod_perl2 & POST data | August 31, 2006, 1:59 pm |
| HTTP::Request::Common::POST and UTF-8 | September 27, 2005, 12:21 pm |
| Credentials and POST method with IO::Socket::SSL? | June 30, 2006, 5:14 pm |
| CGI.pm/modperl2 and intermittent missing POST data | July 15, 2006, 3:18 am |
|