use REST::Client; use JSON qw(decode_json); use Data::Dumper; my $client = REST::Client->new(host => 'https://:/api/v1'); $req = "authToken="; $headers = { Accept => '*/*', 'Content-Type' => 'application/x-www-form-urlencoded', }; #Below 2 lines are to bypass the SSL verification which was also causing authentication issues. $client->getUseragent()->ssl_opts(verify_hostname => 0); $client->getUseragent()->ssl_opts(SSL_verify_mode => SSL_verify_NONE); $client->POST('/security/login',$req,$headers); print($client->responseCode()); print($client->responseContent()); exit();