Last active
January 4, 2024 04:43
-
-
Save junho85/72b70570b898b9505922d51dffacc218 to your computer and use it in GitHub Desktop.
perl post request using HTTP::Tiny
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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