#! /usr/bin/perl use warnings; use strict; use Plack::Builder; use Plack::Request; use Data::Dumper; my $APP = sub { my ($env) = @_; my $req = 'Plack::Request'->new($env); [200, [], [Dumper($req)]] }; builder { mount '/' => $APP; }; #### #!/usr/bin/perl use warnings; use strict; use Encode; use Digest::SHA; use MIME::Base64 qw{ encode_base64 }; use LWP::UserAgent; my $ua = 'LWP::UserAgent'->new; my $url = 'http://localhost:5000'; my $str = 'hello'; # no special chars, 1-127 my $sha256 = Digest::SHA::sha256('abc123'); # bytes 0-255 my $hmac = Digest::SHA::hmac_sha512('a message', 'a key'); # bytes 0-255 my $unicode_string = "\N{GREEK SMALL LETTER ALPHA}\N{GREEK SMALL LETTER BETA}ab123"; # unicode chars mixed with lower-ascii my $buffer = ""; # buffer to concatenate above into and POST them for($str, $sha256, $hmac, $unicode_string){ $buffer .= Encode::encode('UTF-8', $_); } my $b64 = encode_base64($buffer); my @HTTPHeader = (ABC => $b64); my $response = $ua->post($url, @HTTPHeader, Content => $b64); # <-- Change to your liking. use Data::Dumper; print Dumper $response->content; ...