Request<T> class

A request holds all the information necessary to make a request to the api.

T is the type of the deserialized body.

A request is immutable and can be executed multiple times, each time returning a new Response. To execute it and receive a Response, call go.

The internal state of httpRequest and jsonBody should not be mutated.

Available Extensions
Annotations
  • @immutable

Constructors

Request({required UnsplashClient client, required Request httpRequest, dynamic jsonBody, required bool isPublicAction, BodyDeserializer<T>? bodyDeserializer})
Creates a new request.
const

Properties

bodyDeserializer BodyDeserializer<T>?
The function used to transform the json response into T.
final
client UnsplashClient
The UnsplashClient this request was created with.
final
hashCode int
The hash code for this object.
no setteroverride
httpRequest → Request
The http.Request, as built by the endpoint, which created this request.
final
isPublicAction bool
Whether this is a public action.
final
jsonBody → dynamic
The common dart json representation of the request body.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

go() Future<Response<T>>
Execute this Request and return its Response.
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