uploadMultipartFormWithHttpInfo method
Future<Response>
uploadMultipartFormWithHttpInfo({
- String? contentType,
- String? filename,
- String? xFilename,
- 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:
-
String contentType: Optional content type of attachment
-
String filename: Optional name of file
-
String xFilename: Optional content type header of attachment
-
UploadMultipartFormRequest uploadMultipartFormRequest:
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,
);
}