Catmandu::Fix::get_json(3pm) | User Contributed Perl Documentation | Catmandu::Fix::get_json(3pm) |
Catmandu::Fix::get_json - get JSON data from an URL as fix function
# fetches a hash or array get_json("http://example.com/json") # stores it in path.key get_json("http://example.com/json", path: path.key) # add URL query parameters or URL path from config get_json("http://example.com/", vars: config) # fill URL template fields from config get_json("http://example.com/{name}.json", vars: config) # get URL or URL template from a field get_json(field.name)
This Catmandu::Fix provides a method to fetch JSON data from an URL. The response is added as new item or to a field of the current item.
The first argument must be an URL, an URL template, or a field where to take an URL or URL template from. Additional options include:
The fix function also supports options "dry", "cache", "timeout", "agent", "proxy", and "wait" as documented in Catmandu::Importer::getJSON. Options "client", "headers", and "warn" are not supported.
2022-12-10 | perl v5.36.0 |