postStreamed<T> method
Stream<Result<T> >
postStreamed<T>(
- String path, {
- dynamic data,
- Map<
String, dynamic> ? queryParameters, - FutureOr<
T> onSuccess(- dynamic data
- FutureOr<
T> onError(- dynamic data
- RestApiClientRequestOptions? options,
override
Implementation
@override
Stream<Result<T>> postStreamed<T>(
String path, {
data,
Map<String, dynamic>? queryParameters,
FutureOr<T> Function(dynamic data)? onSuccess,
FutureOr<T> Function(dynamic data)? onError,
RestApiClientRequestOptions? options,
}) async* {
if (_options.cacheEnabled) {
final cachedResult = await postCached(
path,
queryParameters: queryParameters,
data: data,
onSuccess: onSuccess,
);
if (cachedResult.hasData) {
yield cachedResult;
}
}
yield await post(
path,
queryParameters: queryParameters,
data: data,
onSuccess: onSuccess,
options: options,
);
}