processDocument method Null safety
Process document from url.
Returns a Map
containing the processed document information
from the fileData
using the desired or default options.
Implementation
Future<Map<String, dynamic>> processDocument(String fileName, String fileData,
{List<String>? categories,
bool deleteAfterProcessing = false,
Map<String, dynamic>? params}) {
final Map<String, dynamic> body = params ?? {};
body['categories'] = categories ?? [];
body['auto_delete'] = deleteAfterProcessing;
body['file_data'] = fileData;
body['file_name'] = fileName;
return request(HTTPMethod.post, 'documents', body: body);
}