ingestV1IngestPostWithHttpInfo method

Future<Response> ingestV1IngestPostWithHttpInfo(
  1. MultipartFile file
)

Ingest

Ingests and processes a file. Deprecated. Use ingest/file instead.

Note: This method returns the HTTP Response.

Parameters:

  • MultipartFile file (required):

Implementation

Future<Response> ingestV1IngestPostWithHttpInfo(MultipartFile file,) async {
  // ignore: prefer_const_declarations
  final path = r'/v1/ingest';

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['multipart/form-data'];

  bool hasFields = false;
  final mp = MultipartRequest('POST', Uri.parse(path));
  hasFields = true;
  mp.fields[r'file'] = file.field;
  mp.files.add(file);
  if (hasFields) {
    postBody = mp;
  }

  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}