Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: post JSON using HTTP::Tiny - cannot parse URL

by 1nickt (Canon)
on Apr 23, 2020 at 20:23 UTC ( [id://11115974]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -Mstrict -MJSON -MData::Dumper -MHTTP::Tiny -E'my $resp = HTTP:
    +:Tiny->new->post("https://moneybird.com/api/v2/123/external_sales_inv
    +oices", { headers => {Accept => "application/json", "Content-Type" =>
    + "application/json", Authorization => "Bearer 123"}, content => to_js
    +on({ external_sales_invoices => { "reference" => "M-8426", "date" => 
    +"2020-03-14", "contact_id" => 456, "details_attributes" => [ { "descr
    +iption" => "coffee", "price" => 2.25, "tax_rate_id" => 891 } ] } })})
    +; say Dumper $resp->{content}'
    
  2. or download this
    $VAR1 = '{"error":"access token invalid","symbolic":{"request":"invali
    +d_grant"}}';
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11115974]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-19 11:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found