Finally it is working. thanks for all help and pointers shared with me which helped me to learn a lot and make it work. For rest of community users (like me 🙂 ) below are the issues and resolutions.

From the Quest REST API documentation,

  • I didn't find what all supported headers should be there in PERL code to support the REST Call.
  • No where was mentioned that authToken OR user/password need to be supplied as Request Body/Content.
  • May be i missed in those things in documentation or due to as i have limited knowledge with Quest and PERL 🙂
  • Anyway, I tried POSTMAN and downloaded the QUEST collection and started working on it and then came to know about above issues and corrective actions and it worked afterwards. For community users, below is the short code for authentication:

    use REST::Client; use JSON qw(decode_json); use Data::Dumper; my $client = REST::Client->new(host => 'https://<Your Host>:<APIPort>/ +api/v1'); $req = "authToken=<Authentication Token Value>"; $headers = { Accept => '*/*', 'Content-Type' => 'application/x-www-form-urlencoded', }; #Below 2 lines are to bypass the SSL verification which was also causi +ng 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();

    In reply to Re^2: REST::Client + Request Body by ravigupta1
    in thread REST::Client + Request Body by ravigupta1

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.