-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy path__init__.py
94 lines (85 loc) · 1.95 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# SPDX-FileCopyrightText: Copyright (c) 2022 Dan Halbert for Adafruit Industries, Michał Pokusa
#
# SPDX-License-Identifier: MIT
"""
`adafruit_httpserver`
================================================================================
Socket based HTTP Server for CircuitPython
* Author(s): Dan Halbert, Michał Pokusa
Implementation Notes
--------------------
**Software and Dependencies:**
* Adafruit CircuitPython firmware for the supported boards:
https://github.com/adafruit/circuitpython/releases
"""
__version__ = "0.0.0+auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer.git"
from .authentication import (
Basic,
Token,
Bearer,
check_authentication,
require_authentication,
)
from .exceptions import (
ServerStoppedError,
AuthenticationError,
InvalidPathError,
ParentDirectoryReferenceError,
BackslashInPathError,
ServingFilesDisabledError,
FileNotExistsError,
)
from .headers import Headers
from .methods import (
GET,
POST,
PUT,
DELETE,
PATCH,
HEAD,
OPTIONS,
TRACE,
CONNECT,
)
from .mime_types import MIMETypes
from .request import QueryParams, FormData, Request
from .response import (
Response,
FileResponse,
ChunkedResponse,
JSONResponse,
Redirect,
SSEResponse,
Websocket,
)
from .route import Route, as_route
from .server import (
Server,
NO_REQUEST,
CONNECTION_TIMED_OUT,
REQUEST_HANDLED_NO_RESPONSE,
REQUEST_HANDLED_RESPONSE_SENT,
)
from .status import (
Status,
SWITCHING_PROTOCOLS_101,
OK_200,
CREATED_201,
ACCEPTED_202,
NO_CONTENT_204,
PARTIAL_CONTENT_206,
MOVED_PERMANENTLY_301,
FOUND_302,
TEMPORARY_REDIRECT_307,
PERMANENT_REDIRECT_308,
BAD_REQUEST_400,
UNAUTHORIZED_401,
FORBIDDEN_403,
NOT_FOUND_404,
METHOD_NOT_ALLOWED_405,
TOO_MANY_REQUESTS_429,
INTERNAL_SERVER_ERROR_500,
NOT_IMPLEMENTED_501,
SERVICE_UNAVAILABLE_503,
)