Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 scrutinizing the Monastery: (3)
As of 2023-06-09 21:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (36 votes). Check out past polls.

    Notices?