postFilesWithRequest<T> method

Future<T> postFilesWithRequest<T>(
  1. IReturn<T> request,
  2. List<UploadFile> files, {
  3. RequestFilter? requestFilter,
  4. ResponseFilter? responseFilter,
})

Posts files with a request DTO using multipart/form-data

request The request DTO files List of file upload entries. Each entry should be a Map with:

  • 'fieldName': String (optional, defaults to 'upload')
  • 'fileName': String
  • 'stream': List
  • 'contentType': String (optional, defaults to 'application/octet-stream') responseAs Optional type to deserialize response as

Implementation

Future<T> postFilesWithRequest<T>(
    IReturn<T> request,
    List<UploadFile> files, {
      RequestFilter? requestFilter,
      ResponseFilter? responseFilter,
    }) async {

    return await postFilesWithRequestAs<T>(combinePaths([this.replyBaseUrl, nameOf(request)]),
      request, files, responseAs: request.createResponse(), requestFilter: requestFilter, responseFilter: responseFilter);
}