You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
httr2 offers options for paginated requests (req_perform_iterative) as well as requests that need to be structured as a list (request_sequential). For the latter one, a common use case example would be an API that provides data from countries and a single API call accepts only one country in the request body.
I can build up such a request "loop" and fetch the data as follows:
However, imagine the API uses pagination for each country, i.e. each response has several pages. I can use the above request and map it with req_perform_iterative:
So I need to map twice, once for building the request and then again when fetching the data.
I'm wondering if there is a way or if it would be a valuable new feature for httr2 to offer a combined function, e.g. by adding the req_perform_iterative functionality directly in req_perform_sequential?
httr2 offers options for paginated requests (
req_perform_iterative
) as well as requests that need to be structured as a list (request_sequential
). For the latter one, a common use case example would be an API that provides data from countries and a single API call accepts only one country in the request body.I can build up such a request "loop" and fetch the data as follows:
However, imagine the API uses pagination for each country, i.e. each response has several pages. I can use the above request and
map
it withreq_perform_iterative
:So I need to
map
twice, once for building the request and then again when fetching the data.I'm wondering if there is a way or if it would be a valuable new feature for httr2 to offer a combined function, e.g. by adding the
req_perform_iterative
functionality directly inreq_perform_sequential
?So that the call could look like:
The text was updated successfully, but these errors were encountered: