This function is intended as a replacement for httr2::iterate_with_cursor()
for the common situation where the response body is json, and the cursor can
be "empty" in various ways. Even within a single API, some endpoints might
return a NULL next_cursor to indicate that there are no more pages of
results, while other endpoints might return "". This function normalizes
all such results to NULL.
Arguments
- param_name
(
length-1 character) The name of thecursorparameter in the request.- next_cursor_path
(
character) A vector indicating the path to thenext_cursorelement in the body of the response. For example, for the Slack API, this value isc("response_metadata", "next_cursor"), while for the Crossref Unified Resource API, this value is"next-cursor".