ChopperClient class

ChopperClient is the main class of the Chopper API Used to manager services, encode data, intercept request, response and error.

Constructors

ChopperClient({String baseUrl: '', Client client, Iterable interceptors: const [], Converter converter, ErrorConverter errorConverter, Iterable<ChopperService> services: const []})
Inject any service using the services parameter. See ChopperApi annotation to define a service. [...]

Properties

baseUrl → String
Base url of each request to your api hostname of your api for example
final
converter Converter
Converter call before request interceptor and before interceptor of successful response
final
errorConverter ErrorConverter
Converter call on error request
final
httpClient Client
Http client used to do request from package:http/http.dart
final
onRequest → Stream<Request>
Event stream of request just before http call all converters and interceptors have been run
read-only
onResponse → Stream<Response>
Event stream of response all converters and interceptors have been run
read-only
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

delete<BodyType, InnerType>(String url, {Map<String, String> headers, Map<String, dynamic> parameters, String baseUrl}) → Future<Response<BodyType>>
Http DELETE request using send function
dispose() → void
dispose ChopperClient to clean memory. [...]
@mustCallSuper
get<BodyType, InnerType>(String url, {Map<String, String> headers, Map<String, dynamic> parameters, String baseUrl}) → Future<Response<BodyType>>
Http GET request using send function
getService<ServiceType extends ChopperService>() → ServiceType
Retrieve any service injected into the ChopperClient [...]
Http Head request using send function
patch<BodyType, InnerType>(String url, {dynamic body, List<PartValue> parts, Map<String, String> headers, Map<String, dynamic> parameters, bool multipart, String baseUrl}) → Future<Response<BodyType>>
Http PATCH request using send function
post<BodyType, InnerType>(String url, {dynamic body, List<PartValue> parts, Map<String, String> headers, Map<String, dynamic> parameters, bool multipart, String baseUrl}) → Future<Response<BodyType>>
Http POST request using send function
put<BodyType, InnerType>(String url, {dynamic body, List<PartValue> parts, Map<String, String> headers, Map<String, dynamic> parameters, bool multipart, String baseUrl}) → Future<Response<BodyType>>
Http PUT request using send function
send<BodyType, InnerType>(Request request, {ConvertRequest requestConverter, ConvertResponse responseConverter}) → Future<Response<BodyType>>
Send request function that apply all interceptors and converters [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited