annotate urllib3/contrib/emscripten/request.py @ 9:f9f1d0a0599a

planemo upload for repository https://toolrepo.galaxytrakr.org/view/jpayne/bioproject_to_srr_2/556cac4fb538
author jpayne
date Sun, 05 May 2024 23:58:19 -0400
parents 5eb2d5e3bf22
children
rev   line source
jpayne@7 1 from __future__ import annotations
jpayne@7 2
jpayne@7 3 from dataclasses import dataclass, field
jpayne@7 4
jpayne@7 5 from ..._base_connection import _TYPE_BODY
jpayne@7 6
jpayne@7 7
jpayne@7 8 @dataclass
jpayne@7 9 class EmscriptenRequest:
jpayne@7 10 method: str
jpayne@7 11 url: str
jpayne@7 12 params: dict[str, str] | None = None
jpayne@7 13 body: _TYPE_BODY | None = None
jpayne@7 14 headers: dict[str, str] = field(default_factory=dict)
jpayne@7 15 timeout: float = 0
jpayne@7 16 decode_content: bool = True
jpayne@7 17
jpayne@7 18 def set_header(self, name: str, value: str) -> None:
jpayne@7 19 self.headers[name.capitalize()] = value
jpayne@7 20
jpayne@7 21 def set_body(self, body: _TYPE_BODY | None) -> None:
jpayne@7 22 self.body = body