Request class

An HTTP request where the entire request body is known in advance.

Inheritance
Available extensions

Constructors

Request(String method, Uri url)

Properties

body ↔ String
The body of the request as a string.
getter/setter pair
bodyBytes ↔ Uint8List
The bytes comprising the body of the request.
getter/setter pair
bodyFields ↔ Map<String, String>
The form-encoded fields in the body of the request as a map from field names to values.
getter/setter pair
contentLength ↔ int
The size of the request body, in bytes. This is calculated from bodyBytes.
getter/setter pairoverride
encoding ↔ Encoding
The encoding used for the request.
getter/setter pair
finalized → bool
Whether finalize has 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 followRedirects is 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

copyWith({HttpMethod? method, Uri? url, Map<String, String>? headers, bool? followRedirects, int? maxRedirects, bool? persistentConnection, dynamic body, Encoding? encoding, Map<String, String>? fields, List<MultipartFile>? files, Stream<List<int>>? stream}) → BaseRequest

Available on BaseRequest, provided by the BaseRequestCopyWith extension

Creates a new instance of BaseRequest based of on this. It copies all the properties and overrides the ones sent via parameters.
copyWith({HttpMethod? method, Uri? url, Map<String, String>? headers, String? body, List<int>? bodyBytes, Encoding? encoding, bool? followRedirects, int? maxRedirects, bool? persistentConnection}) → Request

Available on Request, provided by the RequestCopyWith extension

Creates a new instance of Request based of on this. It copies all the properties and overrides the ones sent via parameters.
finalize() → ByteStream
Freezes all mutable fields and returns a single-subscription ByteStream containing the request body.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send() → Future<StreamedResponse>
Sends this request.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited