RestService class Get started Configuration Services
A service that can be used to make requests to a JSON Api. It wraps the client with RestClient if necessary to return a RestResponse. It is recommended to extend this class and add your methods to it where you use client to make requests.
- Inheritance
-
- Object
- HttpService<
RestClient> - RestService
Constructors
-
RestService(Client client, {JsonModelSerializer? serializer, WrapperClientBuilder<
Client> ? builder, bool includeJsonContentTypeHeader = true}) - RestService.fromConfig(RestServiceConfig config)
Properties
- client → RestClient
-
no setterinherited
- config → RestServiceConfig
-
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
buildClient(
HttpServiceConfig< RestClient> config) → RestClient -
inherited
-
dispose(
{bool keepHttpClientAlive = false}) → void -
Closes the service and cleans up any resources associated with it.
It is important to call dispose() to release any resources that are being
used by this REST service, such as the HTTP client.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited