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'};