Skip to main content

HttpHeaders

crawlee._types.HttpHeaders

An immutable mapping for HTTP headers that ensures case-insensitivity for header names.

Index

Constructors

__init__

  • __init__(headers): None
  • Create a new instance.


    Parameters

    • headers: Mapping[str, str] | None = None

    Returns None

Methods

__delitem__

  • __delitem__(key): None
  • Prevent deleting a header, as the object is immutable.


    Parameters

    • key: str

    Returns None

__getitem__

  • __getitem__(key): str
  • Get the value of a header by its name, case-insensitive.


    Parameters

    • key: str

    Returns str

__iter__

  • __iter__(): Iterator[str]
  • Return an iterator over the header names.


    Returns Iterator[str]

__len__

  • __len__(): int
  • Return the number of headers.


    Returns int

__repr__

  • __repr__(): str
  • Return a string representation of the object.


    Returns str

__setitem__

  • __setitem__(key, value): None
  • Prevent setting a header, as the object is immutable.


    Parameters

    • key: str
    • value: str

    Returns None