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/authorize'); $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"); } #### 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