HTTPException
An HTTP exception you can raise in your own code to show errors to the client.
Attributes
| Attribute | Type | Description |
|---|---|---|
| status_code | int | HTTP status code to send to the client. |
| detail | Any = None | Any data to be sent to the client in the detail key of the JSON response. |
| headers | `Mapping[str, str] | None` = None |
Constructor
Signature
def HTTPException(
status_code: int,
detail: Any = None,
headers: Mapping[str, str]| None = None
) - > None
Parameters
| Name | Type | Description |
|---|---|---|
| status_code | int | HTTP status code to send to the client. |
| detail | Any = None | Any data to be sent to the client in the detail key of the JSON response. |
| headers | `Mapping[str, str] | None` = None |
Signature
def HTTPException(
status_code: int,
detail: Any = None,
headers: Mapping[str, str]| None = None
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| status_code | int | HTTP status code to send to the client. |
| detail | Any = None | Any data to be sent to the client in the detail key of the JSON response. |
| headers | `Mapping[str, str] | None` = None |