Skip to contents

Sends an asynchronous HTTP GET request to fetch data from a single API page.

Usage

get_async_page(full_url, nested)

Arguments

full_url

Character string specifying the full URL of the API endpoint to request.

nested

Logical value indicating whether to flatten nested lists in the JSON response.

Value

A future representing the asynchronous operation, which will resolve to a list containing the parsed JSON response.

Details

This function uses future::future() to perform the HTTP GET request asynchronously. It retrieves the content from the specified URL, checks for HTTP errors, and parses the JSON response.

Author

Khaled Al-Shamaa, k.el-shamaa@cgiar.org