KGetRequest<TDecoded> class

GET request wrapper with an optional custom operation and response decoder.

Inheritance

Constructors

KGetRequest(KRestApi _api, {required String path, bool usePrimary = true, Map<String, String>? headers, Object? data, Options? options, Map<String, dynamic>? queryParams, CancelToken? cancelToken, void onReceiveProgress(int, int)?, TDecoded decoder(dynamic data, Response _)?, LogOptions? logOptions, bool useBaseUrl = true, FutureOr<KGetRequest<TDecoded>> resolve(KGetRequest<TDecoded>)?})
KGetRequest.from(KRestRequest<TDecoded> r, {FutureOr<KGetRequest<TDecoded>> resolve(KGetRequest<TDecoded>)?})
factory

Properties

cancelToken CancelToken?
finalinherited
data Object?
finalinherited
decoder → TDecoded Function(dynamic data, Response _)?
Converts the raw Dio response payload into the client-facing output type. data == Response.data
finalinherited
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>?
It will replace the one in Options.headers, don't provide if you wish to use the one in the Options
finalinherited
logOptions LogOptions?
finalinherited
onReceiveProgress → void Function(int, int)?
finalinherited
options Options?
finalinherited
path String
finalinherited
queryParams Map<String, dynamic>?
finalinherited
resolve FutureOr<KGetRequest<TDecoded>> Function(KGetRequest<TDecoded>)?
This can be used to modify or replace the entire request operation
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transformedPath String
no setterinherited
useBaseUrl bool
Set to true by default. You can set to false if you don't want to append with the baseUrl from the parent KRestApiBase and want to provide a full URL in path instead. Doesn't have any effect if the KRestApiBase doesn't have a baseUrl configured, in which case the path is used as-is regardless of this flag.
finalinherited
usePrimary bool
finalinherited

Methods

copyWith({String? pathTransform(String)?, bool? usePrimary, Map<String, String>? headers, Object? data, Map<String, dynamic>? queryParams, Options? options, CancelToken? cancelToken, void onReceiveProgress(int, int)?, LogOptions? logOptions, bool? useBaseUrl, TDecoded decoder(dynamic data, Response _)?}) KGetRequest<TDecoded>
Returns a copy of this request with the supplied overrides.
get() Future<TDecoded?>
getResponse<Raw>() Future<KResponse<Raw, TDecoded>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDeleteRequest() KDeleteRequest<TDecoded>
inherited
toDownloadRequest({required dynamic savePath}) KDownloadRequest<TDecoded>
inherited
toGetRequest() KGetRequest<TDecoded>
inherited
toPatchRequest() KPatchRequest<TDecoded>
inherited
toPostRequest() KPostRequest<TDecoded>
inherited
toPutRequest() KPutRequest<TDecoded>
inherited
toRequest() KRequest<TDecoded>
inherited
toString() String
A string representation of this object.
inherited
tryGet<Raw>() Future<TDecoded?>
tryGetResponse<Raw>() Future<KResponse<Raw, TDecoded>>

Operators

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

Constants

method → const String