HTTP Error 411. The request must be chunked or have a content length.
my $sender = $cgi->param('sender');
my $nums = $cgi->param('nums');
my $msg = $cgi->param('msg');
my $url = "link";
if ($sender, $nums && $msg) {
my $json = encode_json {
username => 'D2028',
password => '8AEBC',
"'{
\"to\": $nums,
\"from\": \"$sender\"
\"message\": \"$msg\"
}'"
}};
my $response = $http->post( $url => {
content => $json,
headers => { 'Content-Type' => 'application/json' },
});
$res = $response->{'content'};
this is the api
curl -X "POST" http://link -H 'username: tttt' -H 'password: ttt' -H "
+Content-Type: application/json" -d '{"to": "444444","from":"Reach","m
+essage":"cURL Message"}'