I tried below code. But the request body are missing.

my $ua = Mojo::UserAgent->new;

my $url = "https://postman-echo.com/post";;

my $tx = $ua->post(

    $url => {

        'Authorization' => 'Basic xxxxxxxxxxxxxx',

        'Content-Type' => 'application/x-www-form-urlencoded'

    } => form => {

        'grant_type' => 'authorization_code',

        'code' => $code,

        'xxx' => '777'

    }

);


Here is a result. I expected value at "form" variables.

'{

"args": {},

"data": "",

"files": {},

"form": {},

"headers": {

"x-forwarded-proto": "https",

"x-forwarded-port": "443",

"host": "postman-echo.com",

"x-amzn-trace-id": "Root=1-653c253d-2bee01d92fa16ed279d4b219",

"content-type": "application/x-www-form-urlencoded",

"authorization": "Basic xxxxxxxxxxxxxx"

},

"json": null,

"url": "https://postman-echo.com/post";

}';


Anyone know the reason?



With regards,


-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/6de1484a-5256-46e3-8ef6-726e30bdd3b2n%40googlegroups.com.

Reply via email to