protocol.py 542 B

123456789101112131415
  1. from typing import Protocol
  2. class HTTPProtocol(Protocol):
  3. """Used for providing static type-checking when parsing through the http protocol"""
  4. def on_message_begin() -> None: ...
  5. def on_url(url: bytes) -> None: ...
  6. def on_header(name: bytes, value: bytes) -> None: ...
  7. def on_headers_complete() -> None: ...
  8. def on_body(body: bytes) -> None: ...
  9. def on_message_complete() -> None: ...
  10. def on_chunk_header() -> None: ...
  11. def on_chunk_complete() -> None: ...
  12. def on_status(status: bytes) -> None: ...