फिर से आज़माए जा सकने वाले HTTP error में क्या होना चाहिए?
“बाद में फिर कोशिश करें” पर्याप्त नहीं है। Client को पता होना चाहिए कि स्थिति अस्थायी है या नहीं, कब फिर कोशिश करनी है और पहली कोशिश का असर हुआ या नहीं। Status और Retry-After के साथ API-विशिष्ट Problem Details extensions दें।
“बाद में फिर कोशिश करें” पर्याप्त नहीं है। Client को पता होना चाहिए कि स्थिति अस्थायी है या नहीं, कब फिर कोशिश करनी है और पहली कोशिश का असर हुआ या नहीं। Status और Retry-After के साथ API-विशिष्ट Problem Details extensions दें।
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 अस्थायी अनुपलब्धता बताता है; 429 दर-सीमा। Retry-After प्रतीक्षा के सेकंड या HTTP तारीख देता है। स्थिर type या दस्तावेजीकृत code पर निर्णय लें, मुक्त-पाठ detail को parse न करें। उदाहरण के retryable और operation_result API extensions हैं, RFC standard fields नहीं।
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)