Esc

exchange_response_headers

procedureextensionexperimentalsince 0.36.1Source
  • macOS: exchange_response_headers works on macOS
  • Linux: exchange_response_headers works on Linux
  • Windows: exchange_response_headers works on Windows
  • Wasm: exchange_response_headers works on Wasm

Replaces deferred server response fields before the first write or finish. Fields are copied; caller storage may be released when this returns. Returns false for a client, committed response, concurrent writer or invalid fields.

Signature

exchange_response_headers :: (
    exchange: *Http2_Exchange,
    headers: [] Header_Field
) -> bool
Example
// Without a server-side exchange there is nothing to replace.
exchange: Http2_Exchange;
assert(!exchange_response_headers(*exchange, Header_Field.[.{ name = "x-selected", value = "a" }]));

See also