get_async_pages: Asynchronously Fetch Multiple API Pages

View source: R/http.R

get_async_pagesR Documentation

Asynchronously Fetch Multiple API Pages

Description

Sends asynchronous HTTP GET requests to fetch data from multiple API pages concurrently.

Usage

get_async_pages(pages, nested)

Arguments

pages

Character vector of full URLs specifying the API endpoints to request.

nested

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

Details

This function uses future.apply::future_lapply() to perform concurrent HTTP GET requests for multiple pages. It retrieves and parses the JSON responses from each URL provided.

Value

A list of parsed JSON responses from each page.

Author(s)

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


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