RestProvider class

Retrieves from an HTTP endpoint

Implemented types

Constructors

RestProvider(String baseEndpoint, {RestModelDictionary modelDictionary, Client client})

Properties

baseEndpoint String
A fully-qualified URL
final
client Client
All requests pass through this client.
read / write
defaultHeaders Map<String, String>
Headers supplied for every get, delete, and upsert call.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
modelDictionary RestModelDictionary
The glue between app models and generated adapters.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

delete<_Model extends RestModel>(_Model instance, {Query query, ModelRepository<RestModel> repository}) Future<Response>
Sends a DELETE request method to the endpoint
override
get<_Model extends RestModel>({Query query, ModelRepository<RestModel> repository}) Future<List<_Model>>
Query's providerArgs can extend the get functionality: [...]
override
headersForQuery([Query query]) Map<String, String>
Expand a query into HTTP headers
@protected
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
statusCodeIsSuccessful(int statusCode) bool
toString() String
Returns a string representation of this object.
inherited
upsert<_Model extends RestModel>(_Model instance, {Query query, ModelRepository<RestModel> repository}) Future<Response>
Query's providerArgs can extend the upsert functionality: [...]
override
urlForModel<_Model extends RestModel>(Query query, [_Model instance]) String
Given a model instance and a query, produce a fully-qualified URL
@protected

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited