Sorry for confusions .Updated the code

use strict; use warnings; use LWP::UserAgent; use HTML::Entities; use HTTP::Request; use Data::Dumper; use HTTP::Headers; use URI; my $ua = LWP::UserAgent->new(); my $uri = URI->new('https://synchronydev.oktapreview.com/oauth2/v1/aut +horize'); $uri->query_form(client_id => 'xxxxxxxxxxxxxxxxxx',response_type=>' +code', scope=>'openid',redirect_uri=>'https://testchandan.com:5001/', +state=>'1234', nonce=>'UBGW'); print Dumper "$uri\n"; my $response1 = $ua->get($uri); my $responsecode = $response1->code() ; my $responsecontent = $response1->content(); print "$responsecode\n"; print "$responsecontent\n"; unless($response1->is_success(),$response1->code) { die($response1->code, "\n", $response1->content, "\n"); }

post sign in - I have received the below headers and i will need to capture the code value.

Request URL: https://testchandan.com:5001/?code=E1XqzJxB-OMLscNAJtWZG1 +_wthVln5UfNIWwAS5YDU8&state=1234 Request Method: GET Status Code: 200 OK Remote Address: 10.10.1.20:5001 Referrer Policy: strict-origin-when-cross-origin o) Chrome/88.0.4324.104 Safari/537.36 code: E1XqzJxB-OMLscNAJtWZG1_wthVln5UfNIWwAS5YDU8 state: 1234

In reply to Re^2: Capturing query string parameter from Header response. by chandantul
in thread Capturing query string parameter from Header response. by chandantul

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.