SseRequest class final
An HTTP request where the entire request body is known in advance.
- Available extensions
Constructors
-
SseRequest({required String method, required Uri uri, Map<
String, String> ? headers, Map<String, dynamic> ? body, Encoding? encoding}) - Creates an SSE request with the specified method, URI, headers, body, and encoding.
-
SseRequest.get({required Uri uri, Map<
String, String> ? headers, Encoding? encoding}) - Creates an SSE GET request.
-
SseRequest.post({required Uri uri, Map<
String, String> ? headers, Map<String, dynamic> ? body, Encoding? encoding}) - Creates an SSE POST request.
Properties
- body ↔ String
-
The body of the request as a string.
getter/setter pairinherited
- bodyBytes ↔ Uint8List
-
The bytes comprising the body of the request.
getter/setter pairinherited
-
bodyFields
↔ Map<
String, String> -
The form-encoded fields in the body of the request as a map from field
names to values.
getter/setter pairinherited
- contentLength ↔ int
-
The size of the request body, in bytes. This is calculated from
bodyBytes.getter/setter pairinherited - encoding ↔ Encoding
-
The encoding used for the request.
getter/setter pairinherited
- finalized → bool
-
Whether
finalizehas been called.no setterinherited - followRedirects ↔ bool
-
Whether the client should follow redirects while resolving this request.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, String> -
The HTTP headers sent to the server.
finalinherited
- maxRedirects ↔ int
-
The maximum number of redirects to follow when
followRedirectsis true.getter/setter pairinherited - method → String
-
The HTTP method of the request.
finalinherited
- persistentConnection ↔ bool
-
Whether a persistent connection should be maintained with the server.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- url → Uri
-
The URL to which the request will be sent.
finalinherited
Methods
-
finalize(
) → ByteStream -
Freezes all mutable fields and returns a single-subscription
ByteStreamcontaining the request body.inherited -
getRequestStream(
{required String subName, bool useBroadCast = false}) → Stream< Map< String, dynamic> > -
Available on BaseRequest, provided by the RequestHandlers extension
Returns a stream of parsed SSE events. -
getStream(
String subName, [bool useBroadCast = false]) → Stream< Map< String, dynamic> > - Returns a stream of parsed SSE events.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send(
) → Future< StreamedResponse> -
Sends this request.
inherited
-
sendStreamed(
Client? client) → Future< Stream< Map< >String, dynamic> > -
Sends the request and transforms
ByteStreamto Map<String, dynamic> for every event. -
sendStreamedRequest(
{Client? client, Encoding? encoding}) → Future< Stream< Map< >String, dynamic> > -
Available on BaseRequest, provided by the RequestHandlers extension
Sends the request and transformsByteStreamto Map<String, dynamic> for every event. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited