blackbull.request¶
blackbull.request
¶
Request body and cookie helpers.
Provides:
read_body: buffers all ASGIhttp.requestchunks into a singlebytesobject.parse_cookies: parses theCookierequest header into adict[str, str].
parse_cookies(scope)
¶
Parse the Cookie request header from an ASGI scope into a dict.
Works identically for HTTP/1.1, HTTP/2, and WebSocket scopes.
HTTP/1.1 sends a single combined Cookie header; HTTP/2 may split it
into multiple fields (RFC 7540 ยง8.1.2.5). This function uses
Headers.getlist to collect all cookie fields before joining and
parsing, so both wire formats produce the same result.
read_body(receive)
async
¶
Read the complete request body from the ASGI receive channel.