Hello Smart Monks,I am getting 400 bad request in my code.

https://dev.preview.com/oauth2/default/v1/authorize?client_id=xxxxxxxx +xxxxxxxxxxxxx&response_type=code&scope=openid&redirect_uri=http%3A%2F +%2Ftestchandan.com%3A5001&state=1234&nonce=UBGW

I was trying to write below code for constructing above query but getting Bad request but the same query working fine in the browser

I will need to develop the above query. is that possible for your to tell me where i am doing wrong here in my below code?

use strict; #use warning; use JSON; use JSON::WebToken; use LWP::UserAgent; use HTML::Entities; use LWP::Authen::OAuth2; use HTTP::Request; use Data::Dumper; use HTTP::Headers; my $ua = LWP::UserAgent->new(); $ua->proxy([ 'http' ], 'http://proxy.myorg.com:8080'); my $response1 = $ua->get( 'https://dev.preview.com/oauth2/default/v1/authorize?', client_id => '******************', response_type => 'code', scope => 'openid', redirect_uri => 'http%3A%2F%2Ftestchandan.com%3A5001', state => '1234', nonce => 'UBGW' ); print Dumper ($ua); unless($response1->is_success()) { die($response1->code, "\n", $response1->content, "\n"); }

In reply to Need to resolve the API call query 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.