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

Inheritance

Constructors

Request(String method, Uri url)

Creates a new HTTP request.

Properties

body String

The body of the request as a string. This is converted to and from bodyBytes using encoding.

read / write
bodyBytes Uint8List

The bytes comprising the body of the request. This is converted to and from body using encoding.

read / write
bodyFields Map<String, String>

The form-encoded fields in the body of the request as a map from field names to values. The form-encoded body is converted to and from bodyBytes using encoding (in the same way as body).

read / write
contentLength int

The size of the request body, in bytes. This is calculated from bodyBytes.

read / write
encoding Encoding

The encoding used for the request. This encoding is used when converting between bodyBytes and body.

read / write
finalized bool

Whether the request has been finalized.

read-only, inherited
followRedirects bool

Whether the client should follow redirects while resolving this request. Defaults to true.

read / write, inherited
hashCode int

Get a hash code for this object.

read-only, inherited
headers Map<String, String>

The headers for this request.

read-only, inherited
maxRedirects int

The maximum number of redirects to follow when followRedirects is true. If this number is exceeded the BaseResponse future will signal a RedirectException. Defaults to 5.

read / write, inherited
method String

The HTTP method of the request. Most commonly "GET" or "POST", less commonly "HEAD", "PUT", or "DELETE". Non-standard method names are also supported.

read-only, inherited
persistentConnection bool

Whether a persistent connection should be maintained with the server. Defaults to true.

read / write, inherited
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited
url Uri

The URL to which the request will be sent.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

inherited

Methods

finalize() ByteStream

Freezes all mutable fields and returns a single-subscription ByteStream containing the request body.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
send() Future<StreamedResponse>

Sends this request.

inherited
toString() String

Returns a string representation of this object.

inherited