Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: content type in LWP::UserAgent

by stevieb (Canon)
on Nov 17, 2022 at 15:33 UTC ( [id://11148225]=note: print w/replies, xml ) Need Help??


in reply to Re: content type in LWP::UserAgent
in thread content type in LWP::UserAgent

I can unequivocally say that what choroba has there works properly. Here's an actual working example I just tested (with some name/data modifications):

use warnings; use strict; use LWP::UserAgent; use JSON; my $ua = LWP::UserAgent->new; my $body_content = { token => 'NTE2M2Q3YmFmMGEzNjEzMGQyZmFmYmViNGEasdfmNzkzMTE3NzI3MWMz +MDhkZjliYWE3NTI1OTg1MDQwNjNlZg' }; my $resp = $ua->post( 'https://my.server.com', 'Content-Type' => 'application/json', 'Content' => encode_json $body_content ); print $resp->decoded_content;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-24 23:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found