Yeniden denenebilir bir HTTP hatası ne içermeli?
“Daha sonra tekrar deneyin” yeterli değildir. İstemci durumun geçici olup olmadığını, ne zaman yeniden deneyeceğini ve ilk denemenin etkili olup olmadığını bilmelidir. Status ve Retry-After ile API’ye özgü Problem Details uzantıları kullanın.
“Daha sonra tekrar deneyin” yeterli değildir. İstemci durumun geçici olup olmadığını, ne zaman yeniden deneyeceğini ve ilk denemenin etkili olup olmadığını bilmelidir. Status ve Retry-After ile API’ye özgü Problem Details uzantıları kullanın.
HTTP/1.1 503 Service Unavailable
Retry-After: 5
Content-Type: application/problem+json
{
"type": "https://api.example.com/problems/temporarily-unavailable",
"title": "Service temporarily unavailable",
"status": 503,
"detail": "The request was not accepted. Retry after the indicated delay.",
"instance": "urn:request:01JEXAMPLE",
"retryable": true,
"operation_result": "not_applied",
"request_id": "01JEXAMPLE"
}Recommended fields and retry safety
503 geçici kullanılamazlığı, 429 hız sınırını belirtir. Retry-After bekleme saniyesi veya HTTP tarihi verir. Serbest detail metnini ayrıştırmayın; sabit type veya belgelenmiş kodla karar verin. Örnekteki retryable ve operation_result RFC standardı değil, API uzantılarıdır.
Sources
[RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html)
[RFC 6585](https://www.rfc-editor.org/rfc/rfc6585.html)
[RFC 9457](https://www.rfc-editor.org/rfc/rfc9457.html)