postBytes method
Future<ParseNetworkResponse>
postBytes(
- String path, {
- Stream<
List< ? data,int> > - ParseNetworkOptions? options,
- ProgressCallback? onSendProgress,
- dynamic cancelToken,
override
Implementation
@override
Future<ParseNetworkResponse> postBytes(
String path, {
Stream<List<int>>? data,
ParseNetworkOptions? options,
ProgressCallback? onSendProgress,
dynamic cancelToken,
}) async {
final http.Response response = await _client.post(
Uri.parse(path),
//Convert the stream to a list
body: await data?.fold<List<int>>(<int>[],
(List<int> previous, List<int> element) => previous..addAll(element)),
headers: options?.headers,
);
return ParseNetworkResponse(
data: response.body, statusCode: response.statusCode);
}