Skip to content

rnet.http1

Configuration options for HTTP/1.1 connections.

rnet.http1

HTTP/1 connection configuration.

Params

Bases: TypedDict

All parameters for HTTP/1 connections.

Source code in rnet/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.
    """

http09_responses instance-attribute

http09_responses

Enable support for HTTP/0.9 responses.

writev instance-attribute

writev

Whether to use vectored writes for HTTP/1 connections.

max_headers instance-attribute

max_headers

Maximum number of headers allowed in HTTP/1 responses.

read_buf_exact_size instance-attribute

read_buf_exact_size

Exact size of the read buffer to use.

max_buf_size instance-attribute

max_buf_size

Maximum buffer size for HTTP/1 connections.

allow_spaces_after_header_name_in_responses instance-attribute

allow_spaces_after_header_name_in_responses

Allow spaces after header names.

ignore_invalid_headers_in_responses instance-attribute

ignore_invalid_headers_in_responses

Ignore invalid headers in responses.

allow_obsolete_multiline_headers_in_responses instance-attribute

allow_obsolete_multiline_headers_in_responses

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 rnet/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.
        """
        ...

__init__

__init__(**kwargs)

Crate a new Http1Options instance.

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