就像常规的HTTP POST请求一样。我们可以添加无限参数作为表单数据。使用iOS AWS S3 SDK上传时怎么样?
我的iOS功能
let uploadRequest = AWSS3TransferManagerUploadRequest();
uploadRequest?.body = NSURL(string: "file://\(path)") as URL!;
uploadRequest?.key = "file_name";
uploadRequest?.bucket = aws_s3_bucket_path;
uploadRequest?.contentType = "image/" + file_extension;
有什么办法可以添加更多参数发送到我的Lambda函数吗?
答案 0 :(得分:1)
您可以add extra parameters
向metaData
提出请求。
let uploadRequest = AWSS3TransferManagerUploadRequest();
uploadRequest?.body = NSURL(string: "file://\(path)") as URL!;
uploadRequest?.key = "file_name";
uploadRequest?.bucket = aws_s3_bucket_path;
uploadRequest?.contentType = "image/" + file_extension;
uploadRequest?.metadata = ["PhotoTitle" : " testName", "PhotoCaption" : "TestCaption", "UserName" : "TestName", "UserAge" : "TestAge"]
感谢:)