Module z_fetch

Fetch data from URLs.

Copyright © 2021 Marc Worrell

Authors: Marc Worrell (marc@worrell.nl).

Description

Fetch data from URLs. Interfaces to z_url_fetch and z_url_metadata.

Function Index

as_data_url/3Fetch data from an URL.
error_msg/2Map (http) errors to readable format.
fetch/3Fetch data from an URL.
fetch_json/3Fetch JSON data from an URL.
fetch_partial/3Fetch data from an URL.
metadata/3Fetch the metadata from an URL.

Function Details

as_data_url/3

as_data_url(Url::string() | binary() | undefined, Options::z_url_fetch:options(), Context::z:contex()) -> {ok, binary()} | {error, term()}

Fetch data from an URL. Return the data as a data url.

error_msg/2

error_msg(S4xx::integer() | {error, term()}, Context::z:context()) -> binary()

Map (http) errors to readable format.

fetch/3

fetch(Url::string() | binary(), Options::z_url_fetch:options(), Context::z:context()) -> z_url_fetch:fetch_result()

Fetch data from an URL. Let modules change the fetch options.

fetch_json/3

fetch_json(Url::string() | binary(), Options::z_url_fetch:options(), Context::z:context()) -> {ok, term()} | {error, term()}

Fetch JSON data from an URL. Let modules change the fetch options. On success, the returned body is parsed with jsxrecord and returned.

fetch_partial/3

fetch_partial(Url::string() | binary(), Options::z_url_fetch:options(), Context::z:context()) -> z_url_fetch:fetch_result()

Fetch data from an URL. Let modules change the fetch options.

metadata/3

metadata(Url::string() | binary(), Options::z_url_fetch:options(), Context::z:context()) -> {ok, z_url_metadat:metadata()} | {error, term()}

Fetch the metadata from an URL. Let modules change the fetch options.


Generated by EDoc