Skip to contents

Helper functions for httr2::req_retry(). These functions are used in conjunction with the req_retry() function to provide additional information about the retry behavior of the request.

This is particularly necessary when working with the entrata_reports() functions that call the /reports endpoint's getReportData method since this method returns a "queue id" that must be used to check the status of the report generation via a call to the /queue endpoint's getQueueStatus method passing it the "queue id" as a parameter.

Usage

req_should_retry(resp)

req_retry_is_transient(resp)

req_retry_backoff(n)

req_retry_after(resp)

Arguments

resp

httr2::response() object

Value

  • req_should_retry() - Logical value indicating whether the request should be retried.

  • req_retry_is_transient() - Logical value indicating whether the request is transient and should be retried.

  • req_retry_backoff() - The backoff time in seconds.

  • req_retry_after() - The time to wait before retrying the request.

Details

The httr2::req_retry() function alters the HTTP request during httr2::req_perform() so that it will automatically retry in the case of a "transient" error. This is useful when working with APIs that may experience temporary issues that can be resolved by retrying the request.

Functions

  • req_should_retry() - Determines if the request should be retried based off the response's status code.

  • req_retry_is_transient() - Determines if the request is transient and should be retried (applicable for the /queue endpoint's getQueueStatus method).

  • req_retry_backoff() - Determines the backoff time for the request retry in seconds.

  • req_retry_after() - Determines the time to wait before retrying the request based off the response headers.