Skip to content

Instantly share code, notes, and snippets.

@junho85
Last active January 4, 2024 04:43
Show Gist options
  • Save junho85/72b70570b898b9505922d51dffacc218 to your computer and use it in GitHub Desktop.
Save junho85/72b70570b898b9505922d51dffacc218 to your computer and use it in GitHub Desktop.
perl post request using HTTP::Tiny
use HTTP::Tiny;
use JSON;
my $ua = HTTP::Tiny->new();
my $somehash->{"somekey"} = {
ip => "111.111.111.111"
};
my $url = "http://testurl.com:8080/api/test";
my $response = $ua->post($url, {
content => encode_json($somehash)
});
print $response->{content};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment