NAME
Unblock::HTTP3::Transaction - one HTTP/3 request and response transaction
DESCRIPTION
A Transaction represents one HTTP request/response exchange carried by one HTTP/3 request stream.
request() returns the Uniform request. response() returns the final Uniform response when one is available.
COMMON API
The application-facing API intentionally matches the other Unblock HTTP engines:
respond
write
end
send_informational
A server sends a final response with:
$transaction->respond($response);
For a streaming response:
$transaction->respond(
$response,
stream_body => 1,
);
$transaction->write($chunk);
$transaction->end($last_chunk);
A client request opened with stream_body => 1 uses the same write() and end() methods.
send_informational($response) sends a server-side 1xx response before the final response. HTTP/3 does not use status 101.
ADVANCED BODY API
request_body() and response_body() expose Unblock::HTTP3::Body::Stream or Unblock::HTTP3::Body::Reader when explicit HTTP/3 body control is needed.
The common Transaction methods are a convenience layer over those body objects, not a replacement for them.
STATE
Useful lifecycle methods are:
state
error
is_complete
is_cancelled
is_error
is_terminal
state() returns active, complete, cancelled, or error.
HTTP/3 STATE
stream_id() returns the HTTP/3 request stream ID.
priority() gets or changes RFC 9218 priority state.
local_reset_code(), remote_reset_code(), local_stop_sending_code(), and remote_stop_sending_code() preserve HTTP/3 stream diagnostics.
is_aborted() is true when any RESET_STREAM or STOP_SENDING condition has been recorded.
protocol() and is_extended_connect() expose Extended CONNECT state.
early_data() reports whether the request used QUIC 0-RTT.
INFORMATIONAL RESPONSES
next_informational() returns the next queued informational Response for users of the pull interface.
CAPSULES AND DATAGRAMS
capsules() returns the generic RFC 9297 Capsule stream for an Extended CONNECT Transaction.
HTTP Datagram methods include:
datagrams_enabled
send_datagram
next_datagram
on_datagram
max_datagram_payload_size
CANCELLATION
cancel() cancels the HTTP/3 request stream with H3_REQUEST_CANCELLED.
SEE ALSO
Unblock::HTTP3, Unblock::HTTP3::Client, Unblock::HTTP3::Server, Unblock::HTTP3::Body::Stream, Unblock::HTTP3::Body::Reader
LICENSE
MIT License.