Source code for human_requests.abstraction.request

from dataclasses import dataclass
from typing import Optional

from .cookies import Cookie
from .http import URL, HttpMethod


@dataclass(frozen=True)
[docs] class Request: """Represents all the data passed in the request."""
[docs] method: HttpMethod
"""The method used in the request."""
[docs] url: URL
"""The URL of the request."""
[docs] headers: dict
"""The headers of the request."""
[docs] body: Optional[str | list | dict]
"""The body of the request."""
[docs] cookies: list[Cookie]
"""The cookies passed in the request."""