HTTPRetry
Wraps the HTTP operations (GET, POST, PUT, DELETE, multipart SEND) with retry on network errors.
Used through the shared httpr instance by all CAWS services.
Key points:
- Retries only on SocketException or TimeoutException; HTTP error responses are returned as-is.
- Makes up to 15 attempts with exponential backoff (from the
retrypackage), each delay capped at 30 seconds. - Each attempt times out after 20 seconds (15 for DELETE, 5 for SEND).
Constructors
HTTPRetry
Properties
client
final
Methods
delete
Sends an HTTP DELETE request with the given headers to the given url.
get
Sends an HTTP GET request with the given headers to the given url.
post
Sends an HTTP POST request with the given headers and body to the given url.
put
Sends an HTTP PUT request with the given headers and body to the given url.
send
- MultipartRequest request
Sends a multipart request.
On retry the request is rebuilt, cloning any ClonableMultipartFiles. Other file types are dropped from the retried request.