URLRequest class
A URL load request that is independent of protocol or URL scheme.
Constructors
-
URLRequest({bool? allowsCellularAccess, bool? allowsConstrainedNetworkAccess, bool? allowsExpensiveNetworkAccess, bool? assumesHTTP3Capable, URLRequestAttribution? attribution, Uint8List? body, URLRequestCachePolicy? cachePolicy, Map<
String, String> ? headers, bool? httpShouldHandleCookies, bool? httpShouldUsePipelining, @Deprecated('Use allowsCellularAccess instead') bool? iosAllowsCellularAccess, @Deprecated('Use allowsConstrainedNetworkAccess instead') bool? iosAllowsConstrainedNetworkAccess, @Deprecated('Use allowsExpensiveNetworkAccess instead') bool? iosAllowsExpensiveNetworkAccess, @Deprecated('Use cachePolicy instead') IOSURLRequestCachePolicy? iosCachePolicy, @Deprecated('Use httpShouldHandleCookies instead') bool? iosHttpShouldHandleCookies, @Deprecated('Use httpShouldUsePipelining instead') bool? iosHttpShouldUsePipelining, @Deprecated('Use mainDocumentURL instead') Uri? iosMainDocumentURL, @Deprecated('Use networkServiceType instead') IOSURLRequestNetworkServiceType? iosNetworkServiceType, @Deprecated('Use timeoutInterval instead') double? iosTimeoutInterval, WebUri? mainDocumentURL, String? method, URLRequestNetworkServiceType? networkServiceType, double? timeoutInterval, WebUri? url})
Properties
- allowsCellularAccess ↔ bool?
-
A Boolean value indicating whether the request is allowed to use the built-in cellular radios to satisfy the request.
getter/setter pair
- allowsConstrainedNetworkAccess ↔ bool?
-
A Boolean value that indicates whether the request may use the network when the user has specified Low Data Mode.
getter/setter pair
- allowsExpensiveNetworkAccess ↔ bool?
-
A Boolean value that indicates whether connections may use a network interface that the system considers expensive.
getter/setter pair
- assumesHTTP3Capable ↔ bool?
-
true
if server endpoint is known to support HTTP/3. Enables QUIC racing without HTTP/3 service discovery. Defaults tofalse
. The default may betrue
in a future OS update.getter/setter pair - attribution ↔ URLRequestAttribution?
-
The entities that can make a network request.
getter/setter pair
- body ↔ Uint8List?
-
The data sent as the message body of a request, such as for an HTTP POST request.
getter/setter pair
- cachePolicy ↔ URLRequestCachePolicy?
-
The request’s cache policy.
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
- httpShouldHandleCookies ↔ bool?
-
A Boolean value indicating whether cookies will be sent with and set for this request.
getter/setter pair
- httpShouldUsePipelining ↔ bool?
-
A Boolean value indicating whether the request should transmit before the previous response is received.
getter/setter pair
- iosAllowsCellularAccess ↔ bool?
-
Use allowsCellularAccess instead.
getter/setter pair
- iosAllowsConstrainedNetworkAccess ↔ bool?
-
Use allowsConstrainedNetworkAccess instead.
getter/setter pair
- iosAllowsExpensiveNetworkAccess ↔ bool?
-
Use allowsExpensiveNetworkAccess instead.
getter/setter pair
- iosCachePolicy ↔ IOSURLRequestCachePolicy?
-
Use cachePolicy instead.
getter/setter pair
- iosHttpShouldHandleCookies ↔ bool?
-
Use httpShouldHandleCookies instead.
getter/setter pair
- iosHttpShouldUsePipelining ↔ bool?
-
Use httpShouldUsePipelining instead.
getter/setter pair
- iosMainDocumentURL ↔ Uri?
-
Use mainDocumentURL instead.
getter/setter pair
- iosNetworkServiceType ↔ IOSURLRequestNetworkServiceType?
-
Use networkServiceType instead.
getter/setter pair
- iosTimeoutInterval ↔ double?
-
Use timeoutInterval instead.
getter/setter pair
- mainDocumentURL ↔ WebUri?
-
The main document URL associated with this request.
This URL is used for the cookie “same domain as main document” policy.
getter/setter pair
- method ↔ String?
-
The HTTP request method.
getter/setter pair
- networkServiceType ↔ URLRequestNetworkServiceType?
-
The service type associated with this request.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeoutInterval ↔ double?
-
The timeout interval of the request.
getter/setter pair
- url ↔ WebUri?
-
The URL of the request. Setting this to
null
will loadabout:blank
.getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts instance to a map.
-
toMap(
) → Map< String, dynamic> - Converts instance to a map.
-
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? - Gets a possible URLRequest instance from a Map value.