File: http.py

package info (click to toggle)
python-aiohttp 3.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 5,612 kB
  • sloc: python: 36,917; ansic: 15,734; makefile: 365; sh: 83
file content (39 lines) | stat: -rw-r--r-- 1,458 bytes parent folder | download
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
import http.server
import sys
from typing import Mapping, Tuple  # noqa

from . import __version__
from .http_exceptions import HttpProcessingError
from .http_parser import (HeadersParser, HttpParser, HttpRequestParser,
                          HttpResponseParser, RawRequestMessage,
                          RawResponseMessage)
from .http_websocket import (WS_CLOSED_MESSAGE, WS_CLOSING_MESSAGE, WS_KEY,
                             WebSocketError, WebSocketReader, WebSocketWriter,
                             WSCloseCode, WSMessage, WSMsgType, ws_ext_gen,
                             ws_ext_parse)
from .http_writer import (HttpVersion, HttpVersion10, HttpVersion11,
                          StreamWriter)


__all__ = (
    'HttpProcessingError', 'RESPONSES', 'SERVER_SOFTWARE',

    # .http_writer
    'StreamWriter', 'HttpVersion', 'HttpVersion10', 'HttpVersion11',

    # .http_parser
    'HeadersParser', 'HttpParser',
    'HttpRequestParser', 'HttpResponseParser',
    'RawRequestMessage', 'RawResponseMessage',

    # .http_websocket
    'WS_CLOSED_MESSAGE', 'WS_CLOSING_MESSAGE', 'WS_KEY',
    'WebSocketReader', 'WebSocketWriter', 'ws_ext_gen', 'ws_ext_parse',
    'WSMessage', 'WebSocketError', 'WSMsgType', 'WSCloseCode',
)


SERVER_SOFTWARE = 'Python/{0[0]}.{0[1]} aiohttp/{1}'.format(
    sys.version_info, __version__)  # type: str

RESPONSES = http.server.BaseHTTPRequestHandler.responses  # type: Mapping[int, Tuple[str, str]]  # noqa