Http3Request class
An HTTP/3 request with pseudo-headers, regular headers, and optional body.
Represents a single HTTP/3 request message as defined in RFC 9114.
Pseudo-headers (:method, :path, :scheme, :authority) are
automatically generated during encoding; callers supply the HTTP method,
path, regular headers, and an optional binary body.
Http3Request objects are passed to Http3Connection.sendRequest, which QPACK-encodes the headers and stages the request on a new QUIC stream.
Example
final request = Http3Request(
method: 'POST',
path: '/api/data',
headers: {
'host': 'example.com',
'content-type': 'application/json',
},
body: Uint8List.fromList(utf8.encode('{"key":"value"}')),
);
final encoded = request.encodeHeaders();
See also:
- Http3Connection.sendRequest — sends this request over QUIC.
- Http3Response — the corresponding response type.
- RFC 9114 Section 4.1 — HTTP/3 Request Stream.
Constructors
Properties
- body → Uint8List?
-
The optional request body.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, String> -
Regular HTTP headers (excluding pseudo-headers).
final
- method → String
-
The HTTP method (e.g.
'GET','POST','PUT').final - path → String
-
The request target path (e.g.
'/index.html').final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
encodeHeaders(
{QpackEncoder? encoder}) → Uint8List - Encode the request headers as a QPACK-encoded field section.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
decodeHeaders(
Uint8List bytes) → Http3Request - Decode a QPACK-encoded field section into an Http3Request.