[curl] Retry failed HTTP requests

Created on November 30, 2026

Use --retry to retry transient failures. The following command allows up to three retries after the original attempt.

curl --retry 3 https://example.com/

Use --retry-delay to set a fixed wait in seconds before each retry. This example waits two seconds.

curl --retry 3 --retry-delay 2 https://example.com/

Use --retry-connrefused to include connection-refused errors or --retry-all-errors to retry a wider range of errors.

curl --retry 3 --retry-all-errors https://example.com/
Shell command