in reply to Re^2: parsing curl api
in thread parsing curl api
The \x2520 means that a space character (originally encoded as %20) gets written as \x2520, that is, as \x25 (the percent sign) and then the 20.
I think you will need to properly URL-encode your payload, but I don't know what parts you actually need to change.
I think in my example, you can simply replace all \x25 by % and it will still work. But all + will need to be encoded as %2b, because that's how URL-encoded stuff works.
The main problem that I now see in your code is that you are constructing an URL that contains the form parameters. This is not how POST requests work. You need to put the form parameters in the request body. Most likely something like the following will work:
my %form = ( To => "+1234", From => "+5678", Body => "Hello Friend", ); my $res = $ua->post( $url, \%form );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: parsing curl api
by frank1 (Monk) on Mar 24, 2022 at 13:01 UTC | |
by Corion (Patriarch) on Mar 24, 2022 at 13:48 UTC | |
by frank1 (Monk) on Mar 24, 2022 at 14:29 UTC |