MCPcopy
hub / github.com/benoitc/gunicorn / _get_reason_phrase

Method _get_reason_phrase

gunicorn/asgi/protocol.py:1411–1448  ·  view source on GitHub ↗

Get HTTP reason phrase for status code.

(self, status)

Source from the content-addressed store, hash-verified

1409 self._safe_write(body)
1410
1411 def _get_reason_phrase(self, status):
1412 """Get HTTP reason phrase for status code."""
1413 reasons = {
1414 100: "Continue",
1415 101: "Switching Protocols",
1416 103: "Early Hints",
1417 200: "OK",
1418 201: "Created",
1419 202: "Accepted",
1420 204: "No Content",
1421 206: "Partial Content",
1422 301: "Moved Permanently",
1423 302: "Found",
1424 303: "See Other",
1425 304: "Not Modified",
1426 307: "Temporary Redirect",
1427 308: "Permanent Redirect",
1428 400: "Bad Request",
1429 401: "Unauthorized",
1430 403: "Forbidden",
1431 404: "Not Found",
1432 405: "Method Not Allowed",
1433 408: "Request Timeout",
1434 409: "Conflict",
1435 410: "Gone",
1436 411: "Length Required",
1437 413: "Payload Too Large",
1438 414: "URI Too Long",
1439 415: "Unsupported Media Type",
1440 422: "Unprocessable Entity",
1441 429: "Too Many Requests",
1442 500: "Internal Server Error",
1443 501: "Not Implemented",
1444 502: "Bad Gateway",
1445 503: "Service Unavailable",
1446 504: "Gateway Timeout",
1447 }
1448 return reasons.get(status, "Unknown")
1449
1450 def _close_transport(self):
1451 """Close the transport safely.

Calls 1

getMethod · 0.45