BambooHR.HTTPClient.Req (BambooHR v0.5.0)

Copy Markdown View Source

HTTP client implementation using Req.

Retry policy

Unless the caller passes :retry explicitly, requests use a custom retry policy via retry?/2:

  • HTTP 429 responses are retried for all methods. BambooHR rate limits apply per-key regardless of verb, and 429 means the request was not processed so retrying a POST is safe. The Retry-After header is honoured by Req's default :retry_delay.
  • GET and HEAD additionally retry on 408/500/502/503/504 and the same transient transport errors as Req's :safe_transient mode.
  • POST is not retried on 5xx — those could indicate partial processing.

Callers can override by passing retry: in opts (e.g. retry: false to disable, or a custom function).

Summary

Functions

Retry predicate passed to Req. Returns true to retry, false otherwise.

Functions

retry?(request, response_or_exception)

@spec retry?(Req.Request.t(), Req.Response.t() | Exception.t()) :: boolean()

Retry predicate passed to Req. Returns true to retry, false otherwise.