Module Contents

class pex.proto.http.client.HTTPClient

Bases: object

Subclass of pex.proto.http module.

This subclass of pex.proto.http module represents Python implementation of the HTTP socket.

http_request(method: str, host: str, port: int, path: str = '/', ssl: bool = False, timeout: int = 10, output: bool = True, session: Any = requests, **kwargs) str | None

Send HTTP request.

  • method (str) – HTTP method (GET, POST, DELETE, HEAD, OPTIONS)

  • host (str) – HTTP host

  • port (int) – HTTP port

  • path (str) – HTTP path

  • ssl (bool) – True if HTTP uses SSL else False

  • timeout (int) – connection timeout

  • output (bool) – True if wait for output else False

  • session (Any) – request handler

Return Union[str, None]:

output if output is True else None