Alamofire Multipart is not working in XCode 9.4.1


Alamofire Multipart is not working in XCode 9.4.1



When I've upgrade my XCode version to 9.4.1, Alamofire Multipart is not working and I don't know why. It was completely working in previous XCode version.


9.4.1



Please let me know how to fix it. Thanks


Alamofire.upload(
multipartFormData: { multipartFormData in
multipartFormData.append(self.imageFrontData, withName: "front-photo", fileName: "front-photo.png", mimeType: "image/png")
multipartFormData.append(self.imageBackData, withName: "back-photo", fileName: "back-photo.png", mimeType: "image/png")
for (key, value) in parameters {
multipartFormData.append((value?.data(using: String.Encoding.utf8)!)!, withName: key)
}
}, usingThreshold: UInt64.init(), to: uploadURL!, method: .post, headers: headers) { (result) in
switch result {
case .success(let upload, _, _):
upload.responseJSON { response in
print("Succesfully uploaded")
if let err = response.error{
print("err (err.localizedDescription)")
}
}
case .failure(let encodingError):

}
}









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

List of Kim Possible characters

Audio Livestreaming with Python & Flask

NSwag: Generate C# Client from multiple Versions of an API