URLRequest class

A URL load request that is independent of protocol or URL scheme.

Constructors

URLRequest({required Uri? url, String? method, Map<String, String>? headers, Uint8List? body, bool? iosAllowsCellularAccess, bool? iosAllowsConstrainedNetworkAccess, bool? iosAllowsExpensiveNetworkAccess, IOSURLRequestCachePolicy? iosCachePolicy, bool? iosHttpShouldHandleCookies, bool? iosHttpShouldUsePipelining, IOSURLRequestNetworkServiceType? iosNetworkServiceType, double? iosTimeoutInterval, Uri? iosMainDocumentURL})

Properties

body Uint8List?
The data sent as the message body of a request, such as for an HTTP POST request.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>?
A dictionary containing all of the HTTP header fields for a request.
getter/setter pair
iosAllowsCellularAccess bool?
A Boolean value indicating whether the request is allowed to use the built-in cellular radios to satisfy the request.
getter/setter pair
iosAllowsConstrainedNetworkAccess bool?
A Boolean value that indicates whether the request may use the network when the user has specified Low Data Mode.
getter/setter pair
iosAllowsExpensiveNetworkAccess bool?
A Boolean value that indicates whether connections may use a network interface that the system considers expensive.
getter/setter pair
iosCachePolicy IOSURLRequestCachePolicy?
The request’s cache policy.
getter/setter pair
iosHttpShouldHandleCookies bool?
A Boolean value indicating whether cookies will be sent with and set for this request.
getter/setter pair
iosHttpShouldUsePipelining bool?
A Boolean value indicating whether the request should transmit before the previous response is received.
getter/setter pair
iosMainDocumentURL Uri?
The main document URL associated with this request. This URL is used for the cookie “same domain as main document” policy.
getter/setter pair
iosNetworkServiceType IOSURLRequestNetworkServiceType?
The service type associated with this request.
getter/setter pair
iosTimeoutInterval double?
The timeout interval of the request.
getter/setter pair
method String?
The HTTP request method.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
url Uri?
The URL of the request.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toMap() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

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

Static Methods

fromMap(Map<String, dynamic>? map) URLRequest?