- $req = HTTP::Request->new( $method, $full_uri, undef, encode_json $content );
- $req->header('Content-Type' => 'application/json');
+ if (defined $content) {
+ $req = HTTP::Request->new( $method, $full_uri, undef );
+ $req->header( 'Content-Type' => $content_type );
+ my $bytes = ref($content) ? encode_json($content) : $content;
+ $req->content( $bytes ); # convert to bytes
+ warn "### ",dump($bytes);