Retrying the request can help with resolving any errors that are due to connectivity or perhaps socket timeouts. It is important to be selective when retries should be attempted.
Retrying 4xx errors will probably not help and may end up being counter productive.
The mechanism for retries can differ.
Retry Headers
Different headers exist that can be used to notify us that a request has been rate limited and needs to be retried after certain conditions.
Retry-After- If this is sent with Status Code 429, then this means that the request has been rate limited and you should wait until the indicated time. If sent with status code 503, it means that the service will be unavailable until the given time.
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset