protocol.py 601 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(self) -> None: ...
  5. def on_url(self, url: bytes) -> None: ...
  6. def on_header(self, name: bytes, value: bytes) -> None: ...
  7. def on_headers_complete(self) -> None: ...
  8. def on_body(self, body: bytes) -> None: ...
  9. def on_message_complete(self) -> None: ...
  10. def on_chunk_header(self) -> None: ...
  11. def on_chunk_complete(self) -> None: ...
  12. def on_status(self, status: bytes) -> None: ...