CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
post array with LWP

 



Demerzel
Novice

Sep 21, 2011, 7:59 AM

Post #1 of 2 (2594 views)
post array with LWP Can't Post

I have something like this:

Code
my $ua = LWP::UserAgent->new();   
my $req = POST 'https://ssl.test/?m=documentadd&print=1&override=1&original=1
', [
document =>\%document
];

I tried to do it in different ways, now my %document

Code
my %document ={ 
"title"=> "xxxxxx",
"fromdate"=> "1",
"todate"=> "2"}

My php file returns information that $_POST['document'] is an array (HASH(0x92f7aa8)) but I cant read "title"....
How can I make $_POST['document']['title'] readable?
I triend this:

Code
$resp = $ua->post('http://someurl/test.php', 'Content_Type' => 'multipart/form-data' 
, 'Content => [ \%form ]');

with similar outcome.


Demerzel
Novice

Sep 22, 2011, 11:36 AM

Post #2 of 2 (2557 views)
Re: [Demerzel] post array with LWP [In reply to] Can't Post

After adding condition that converts many post values to array everything works. But it's workaround not real solution.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives