#!/usr/bin/perl use warnings; use strict; use LWP::UserAgent; use Cpanel::JSON::XS qw{ encode_json }; my $ua = 'LWP::UserAgent'->new(timeout => 1); my $response = $ua->post('https://httpbin.org/post', 'content-type' => 'application/json', Content => encode_json({key => 'value'})); print $response->decoded_content;