jpayne@7: from __future__ import annotations jpayne@7: jpayne@7: from dataclasses import dataclass, field jpayne@7: jpayne@7: from ..._base_connection import _TYPE_BODY jpayne@7: jpayne@7: jpayne@7: @dataclass jpayne@7: class EmscriptenRequest: jpayne@7: method: str jpayne@7: url: str jpayne@7: params: dict[str, str] | None = None jpayne@7: body: _TYPE_BODY | None = None jpayne@7: headers: dict[str, str] = field(default_factory=dict) jpayne@7: timeout: float = 0 jpayne@7: decode_content: bool = True jpayne@7: jpayne@7: def set_header(self, name: str, value: str) -> None: jpayne@7: self.headers[name.capitalize()] = value jpayne@7: jpayne@7: def set_body(self, body: _TYPE_BODY | None) -> None: jpayne@7: self.body = body