#!/usr/bin/env perl use strict; use warnings; use REST::Client; my $rest = REST::Client->new ({ host => 'http://httpbin.org' }); my $data = '{"key":"value"}'; my $headers = { Accept => 'application/json', 'Content-type' => 'application/json', }; $rest->POST ('/anything', $data, $headers); print $rest->responseContent;