Skip to content

Headers API

The client.headers namespace exposes CRP HTTP header emission, parsing, canonical-name listing, and safety-halt detection without requiring manual imports.

SDK proxy

crp.sdk.proxies_extra._HeadersProxy

CRP HTTP header surface proxy (SPEC-002).

Exposes header emission, parsing, canonical-name listing, and halt detection without requiring manual imports.

emit(headers=None, **kwargs)

Emit CRP response headers from a mapping of analysis values.

Parameters:

Name Type Description Default
headers dict[str, Any] | None

Optional dict of header inputs forwarded as keyword args.

None
**kwargs Any

Additional header inputs (e.g. session_id, window).

{}

Returns:

Type Description
dict[str, str]

Dict of canonical CRP-* header names to string values.

parse(header_string)

Parse inbound CRP request headers.

Parameters:

Name Type Description Default
header_string Any

A mapping of headers, a raw header string, or a previously parsed RequestDirectives object.

required

Returns:

Type Description
Any

RequestDirectives (or a plain dict fallback).

names()

Return the list of canonical CRP header-name constants.

Returns:

Type Description
list[str]

Sorted list of canonical header-name strings.

should_halt(headers)

Return True if the headers indicate a safety halt.

Parameters:

Name Type Description Default
headers dict[str, str]

Mapping of CRP response headers.

required

Returns:

Type Description
bool

Boolean halt signal.