Skip to content

Trailing Headers #1149

@lovelydinosaur

Description

@lovelydinosaur

One HTTP/1.1 feature that we don't currently support is trailing headers.

Hardly a high priority since it's seems so rarely used, but it might be worth our while someday.
It'd be interesting to hear from folks who do have use-cases here.

One option at the Transport API layer might be to update the AsyncByteStream/SyncByteStream APIs in order to handle this, without affecting the majority of code that doesn't expect or care about trailing headers, for example...

def get_trailing_headers() -> List[Tuple[byte, byte]]:
    # This method depends on the state of `__iter__`/`__aiter__`.
    # Once the byte stream has been fully consumed, any trailing headers may be accessed via this method.
    return []

At the httpx level we could expose this information by mutating the response.headers once the stream has been iterated over.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions