Hello Monks, I was trying to find a way to capture existing header response in my PSGI app but i was not able to access the same and i have used the catalyst::Request but failed to do so. Can you please let me know the way i can achieve the same? Please check my header response.

Request URL: https://testchandan.com:5001/?code=E1XqzJxB-OMLscNAJtWZG1 +_wthVln5UfNIWwAS5YDU8&state=1234 Request Method: GET Status Code: 200 OK Remote Address: 10.10.1.6:5001 Referrer Policy: strict-origin-when-cross-origin Content-Length: 1252 Content-Type: text/html; charset=UTF-8 Date: Mon, 14 Jun 2021 04:59:57 GMT Server: HTTP::Server::PSGI Server: Perl Dancer2 0.301002 Set-Cookie: plack_session=ba1d0d240ba3ed6c6fca13c240c758a6c812200d; pa +th=/ Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/av +if,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q +=0.9 Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9 Connection: keep-alive Host: testchandan.com:5001 Sec-Fetch-Dest: document Sec-Fetch-Mode: navigate Sec-Fetch-Site: cross-site Sec-Fetch-User: ?1 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537. +36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36 code: E1XqzJxB-OMLscNAJtWZG1_wthVln5UfNIWwAS5YDU8 state: 1234

Please check below code that i was trying to capture the same but unable to do so

package Op; use strict; use warnings; use LWP::UserAgent; use URI; my $ua = LWP::UserAgent->new(); my $uri2 = URI->new('https://testchandan.com:5001/dev'); my $response1 = $ua->get($uri2); my $responsecode = $response1->code() print $response1->headers_as_string if $response1->is_success;

In reply to 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.