Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: php arrays to perl

by Corion (Patriarch)
on May 16, 2017 at 11:28 UTC ( [id://1190366]=note: print w/replies, xml ) Need Help??


in reply to php arrays to perl

If you want to create HTTP posts, it is always quite instructive to look at the actual data that gets sent over the wire, regardless of the program(ming language) that generates the data.

So, please look at the data that the PHP program sends to the remote end. It likely is not too hard to create similar data from within Perl, but without a specification things are much harder.

Replies are listed 'Best First'.
Re^2: php arrays to perl
by bigup401 (Pilgrim) on May 16, 2017 at 11:44 UTC

    well, it says missing data text1. thats the problem it cant get text1 data

    my $ua = HTTP::Tiny->new; my $url = "link"; my $param = { text1 => 'text0', text2 => 'text01', text3 => 'text02', }; my $params = $ua->www_form_urlencode( $param ); my $response = $ua->post( $url . '/?' . $params );

      You are trying to send POST data like it was GET data.

      Try this:

      my $ua = HTTP::Tiny->new; my $url = "link"; my $param = { text1 => 'text0', text2 => 'text01', text3 => 'text02', }; my $response = $ua->post_form($url, $param);

        thanks tobyink, it was helpful worked

      In my previous reply I gave you very concrete steps to follow to investigate where the cause of your problems lies:

      1. So, please look at the data that the PHP program sends to the remote end.

      Which of these steps have you followed, and what were the results?

      What were the problems you encountered when trying the steps?

      Please try the steps again and report the exact results.

        "I gave you very concrete steps to follow ..."

        You don't seem to realize that just because you type words, people might not understand them.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1190366]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-25 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found