http://qs321.pair.com?node_id=11118998

ravigupta1 has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I am trying to connect Quest Foglight using REST::Client over https. I tried in PostMan tool and it is working over there but it accept authToken in Request Body.

Appreciate if someone could help me to understand how to pass "authToken" in PERL code as Request Body. Below is my code FYR. This is not working as I am new to PERL and don't know how to pass authToken as request body.

Use REST::Client; my $client = REST::Client->new(); $req = '{"authToken":"<My Auth Token Value>"}'; # Above value should be passed as request Body. As per Postman Tool. $url = "https://<my Quest Server>/api/v1/security/login"; $client->POST($url,$req); print($client->responseCode()); exit();