Esc

exchange_head

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

Waits for initial response headers. The returned fields borrow exchange storage. Byte EOF and status 200 alone do not establish application-protocol success.

Signature

exchange_head :: (
    exchange: *Http2_Exchange
) -> (status: int, fields: [] Header_Field, failure: Client_Error)
Example
// A handle that holds no stream has no head to wait for.
exchange: Http2_Exchange;
status, fields, failure := exchange_head(*exchange);

assert(status == 0 && fields.count == 0);
assert(failure.kind == .TRANSPORT && failure.detail == "exchange is closed");

See also