|
| Context | context (web.Request request) |
| |
| web.Response | json (Any result, HTTPStatus|int status_code=HTTPStatus.OK, LooseHeaders|None headers=None) |
| |
Base view for all views.
Definition at line 107 of file http.py.
◆ context()
| Context homeassistant.helpers.http.HomeAssistantView.context |
( |
web.Request |
request | ) |
|
|
static |
Generate a context from a request.
Definition at line 117 of file http.py.
◆ json()
| web.Response homeassistant.helpers.http.HomeAssistantView.json |
( |
Any |
result, |
|
|
HTTPStatus | int |
status_code = HTTPStatus.OK, |
|
|
LooseHeaders | None |
headers = None |
|
) |
| |
|
static |
Return a JSON response.
Definition at line 125 of file http.py.
◆ json_message()
| web.Response homeassistant.helpers.http.HomeAssistantView.json_message |
( |
|
self, |
|
|
str |
message, |
|
|
HTTPStatus | int |
status_code = HTTPStatus.OK, |
|
|
str | None |
message_code = None, |
|
|
LooseHeaders | None |
headers = None |
|
) |
| |
Return a JSON message response.
Definition at line 151 of file http.py.
◆ register()
| None homeassistant.helpers.http.HomeAssistantView.register |
( |
|
self, |
|
|
HomeAssistant |
hass, |
|
|
web.Application |
app, |
|
|
web.UrlDispatcher
|
router |
|
) |
| |
Register the view with a router.
Definition at line 164 of file http.py.
◆ cors_allowed
| bool homeassistant.helpers.http.HomeAssistantView.cors_allowed = False |
|
static |
◆ None
| homeassistant.helpers.http.HomeAssistantView.None |
|
static |
◆ requires_auth
| bool homeassistant.helpers.http.HomeAssistantView.requires_auth = True |
|
static |
The documentation for this class was generated from the following file: