Skip to content

wreq.http1

Configuration options for HTTP/1.1 connections.

wreq.http1

HTTP/1 connection configuration.

Params typed-dict

Bases: TypedDict

All parameters for HTTP/1 connections.

Source code in python/wreq/http1.py
class Params(TypedDict):
    """
    All parameters for HTTP/1 connections.
    """

    http09_responses: NotRequired[bool]
    """
    Enable support for HTTP/0.9 responses.
    """

    writev: NotRequired[bool]
    """
    Whether to use vectored writes for HTTP/1 connections.
    """

    max_headers: NotRequired[int]
    """
    Maximum number of headers allowed in HTTP/1 responses.
    """

    read_buf_exact_size: NotRequired[int]
    """
    Exact size of the read buffer to use.
    """

    max_buf_size: NotRequired[int]
    """
    Maximum buffer size for HTTP/1 connections.
    """

    allow_spaces_after_header_name_in_responses: NotRequired[bool]
    """
    Allow spaces after header names.
    """

    ignore_invalid_headers_in_responses: NotRequired[bool]
    """
    Ignore invalid headers in responses.
    """

    allow_obsolete_multiline_headers_in_responses: NotRequired[bool]
    """
    Allow obsolete multiline headers.
    """

__init__

__init__(*, http09_responses=..., writev=..., max_headers=..., read_buf_exact_size=..., max_buf_size=..., allow_spaces_after_header_name_in_responses=..., ignore_invalid_headers_in_responses=..., allow_obsolete_multiline_headers_in_responses=...)

Parameters:

Name Type Description Default
http09_responses bool

Enable support for HTTP/0.9 responses.

...
writev bool

Whether to use vectored writes for HTTP/1 connections.

...
max_headers int

Maximum number of headers allowed in HTTP/1 responses.

...
read_buf_exact_size int

Exact size of the read buffer to use.

...
max_buf_size int

Maximum buffer size for HTTP/1 connections.

...
allow_spaces_after_header_name_in_responses bool

Allow spaces after header names.

...
ignore_invalid_headers_in_responses bool

Ignore invalid headers in responses.

...
allow_obsolete_multiline_headers_in_responses bool

Allow obsolete multiline headers.

...

Http1Options

HTTP/1 protocol options for customizing connection behavior. These options allow you to customize the behavior of HTTP/1 connections, such as enabling support for HTTP/0.9 responses, header case preservation, etc.

Source code in python/wreq/http1.py
@final
class Http1Options:
    """
    HTTP/1 protocol options for customizing connection behavior.
    These options allow you to customize the behavior of HTTP/1 connections,
    such as enabling support for HTTP/0.9 responses, header case preservation, etc.
    """

    def __init__(self, **kwargs: Unpack[Params]) -> None:
        """
        Crate a new Http1Options instance.
        """
        ...

    def __str__(self) -> str:
        """
        Return a string representation of the type.
        """
        ...

__init__

__init__(*, http09_responses=..., writev=..., max_headers=..., read_buf_exact_size=..., max_buf_size=..., allow_spaces_after_header_name_in_responses=..., ignore_invalid_headers_in_responses=..., allow_obsolete_multiline_headers_in_responses=...)

Crate a new Http1Options instance.

Parameters:

Name Type Description Default
http09_responses bool

Enable support for HTTP/0.9 responses.

...
writev bool

Whether to use vectored writes for HTTP/1 connections.

...
max_headers int

Maximum number of headers allowed in HTTP/1 responses.

...
read_buf_exact_size int

Exact size of the read buffer to use.

...
max_buf_size int

Maximum buffer size for HTTP/1 connections.

...
allow_spaces_after_header_name_in_responses bool

Allow spaces after header names.

...
ignore_invalid_headers_in_responses bool

Ignore invalid headers in responses.

...
allow_obsolete_multiline_headers_in_responses bool

Allow obsolete multiline headers.

...
Source code in python/wreq/http1.py
def __init__(self, **kwargs: Unpack[Params]) -> None:
    """
    Crate a new Http1Options instance.
    """
    ...

__str__

__str__()

Return a string representation of the type.

Source code in python/wreq/http1.py
def __str__(self) -> str:
    """
    Return a string representation of the type.
    """
    ...