retryableMethods property

Set<String> retryableMethods
final

HTTP methods that are eligible for automatic retry.

Defaults to the idempotent methods per RFC 7231 ยง4.2.2: {GET, HEAD, OPTIONS, TRACE, PUT, DELETE}. POST and PATCH are excluded by default because replaying them is unsafe: a 5xx returned after the server already committed (e.g. a gateway 502/504 timeout on a payment) would otherwise produce a duplicate (double charge).

Comparison is case-insensitive; values must be upper-case.

To retry a specific non-idempotent request that is provably safe to replay (e.g. a POST carrying an Idempotency-Key), prefer the per-request opt-in RequestOptions.forceRetry() over widening this set, which would re-enable retry for every request of that method.

Implementation

final Set<String> retryableMethods;