get_async_page: Asynchronously Fetch a Single API Page

View source: R/http.R

get_async_pageR Documentation

Asynchronously Fetch a Single API Page

Description

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.

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.

Value

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

Author(s)

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


icarda-git/QBMS documentation built on Sept. 25, 2024, 10:45 p.m.