Source code for human_requests.abstraction.request

from dataclasses import dataclass
from typing import TYPE_CHECKING, Optional

from .http import URL, HttpMethod

if TYPE_CHECKING:
    from ..human_page import HumanPage


@dataclass(frozen=True)
[docs] class FetchRequest: """Represents all the data passed in the request."""
[docs] page: "HumanPage"
"""The page that made 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."""