batchRequest function
Future<ParseResponse>
batchRequest(
- List requests,
- List<
ParseObject> objects, { - ParseClient? client,
- bool? debug,
Implementation
Future<ParseResponse> batchRequest(
List<dynamic> requests, List<ParseObject> objects,
{ParseClient? client, bool? debug}) async {
debug = isDebugEnabled(objectLevelDebug: debug);
client = client ??
ParseCoreData().clientCreator(
sendSessionId: ParseCoreData().autoSendSessionId,
securityContext: ParseCoreData().securityContext);
try {
final Uri url = getSanitisedUri(client, '/batch');
final String body = json.encode(<String, dynamic>{'requests': requests});
final ParseNetworkResponse result =
await client.post(url.toString(), data: body);
return handleResponse<ParseObject>(
objects, result, ParseApiRQ.batch, debug, 'parse_utils');
} on Exception catch (e) {
return handleException(e, ParseApiRQ.batch, debug, 'parse_utils');
}
}