putObject method

HttpRequest putObject(
  1. List<int> fileData,
  2. String bucketName,
  3. String fileKey
)

upload file @param fileData type:List

Implementation

HttpRequest putObject(List<int> fileData, String bucketName, String fileKey) {
  final headers = <String, String>{
    'content-md5': md5File(fileData),
    'content-type': contentTypeByFilename(fileKey) ?? 'application/octet-stream'
  };
  final url = "https://${bucketName}.${this.endpoint}/${fileKey}";
  HttpRequest req = HttpRequest(url, 'PUT', <String, dynamic>{}, headers);
  this._auth!.signRequest(req, bucketName, fileKey);
  req.fileData = fileData;
  return req;
}