uploadMultipartFormWithHttpInfo method

Future<Response> uploadMultipartFormWithHttpInfo({
  1. String? contentType,
  2. String? filename,
  3. String? xFilename,
  4. UploadMultipartFormRequest? uploadMultipartFormRequest,
})

Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<Response> uploadMultipartFormWithHttpInfo({ String? contentType, String? filename, String? xFilename, UploadMultipartFormRequest? uploadMultipartFormRequest, }) async {
  // ignore: prefer_const_declarations
  final path = r'/attachments/multipart';

  // ignore: prefer_final_locals
  Object? postBody = uploadMultipartFormRequest;

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

  if (contentType != null) {
    queryParams.addAll(_queryParams('', 'contentType', contentType));
  }
  if (filename != null) {
    queryParams.addAll(_queryParams('', 'filename', filename));
  }
  if (xFilename != null) {
    queryParams.addAll(_queryParams('', 'x-filename', xFilename));
  }

  const contentTypes = <String>['application/json'];


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