Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

smarthacker67's scratchpad

by smarthacker67 (Beadle)
on Jun 12, 2017 at 06:38 UTC ( #1192562=scratchpad: print w/replies, xml ) Need Help??

HI Proj, I am trying to create the equivalent lwp request of following curl. But not sure how to pass -d data in lwp. curl -v <MY URL> -H "Authorization: Bearer <TOKEN>" -d '{"x": "y", "H": {"id": "0"}}' -X OPTIONS code I tried : my $request = HTTP::Request->new(OPTIONS => $self->{url}); $res = $ua->request( $request ,Content => encode_json $body); Method 2:- my $request = HTTP::Request->new(OPTIONS => $self->{url},%$body); $res = $ua->request( $request ); Both didnt work.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2022-12-03 12:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?