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();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: REST::Client + Request Body
by hippo (Bishop) on Jul 07, 2020 at 11:39 UTC | |
by ravigupta1 (Novice) on Jul 07, 2020 at 11:50 UTC | |
by hippo (Bishop) on Jul 07, 2020 at 12:12 UTC | |
Re: REST::Client + Request Body
by perlfan (Vicar) on Jul 07, 2020 at 20:02 UTC | |
by ravigupta1 (Novice) on Jul 09, 2020 at 06:14 UTC | |
by choroba (Cardinal) on Jul 09, 2020 at 09:10 UTC |
Back to
Seekers of Perl Wisdom