HttpCacheRequest class

Represents an HTTP request for caching purposes Simplifies the Core Cache API by encapsulating request data

Constructors

HttpCacheRequest({required String method, required Uri uri, required Map<String, String> headers, CachePolicy? policy})
const
HttpCacheRequest.fromHttpRequest(Request request, {CachePolicy? policy})
Creates a cache request from an http.Request
factory
HttpCacheRequest.get(Uri uri, {Map<String, String>? headers, CachePolicy? policy})
Creates a simple GET request
factory
HttpCacheRequest.post(Uri uri, {Map<String, String>? headers, CachePolicy? policy})
Creates a POST request
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
headers Map<String, String>
final
method String
final
policy CachePolicy?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
uri Uri
final

Methods

copyWith({String? method, Uri? uri, Map<String, String>? headers, CachePolicy? policy}) HttpCacheRequest
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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