I'm trying to upload an image with Alamofire, however it does not seem to upload.
Alamofire.upload(multipartFormData: { multipartFormData in multipartFormData.append(imgData, withName: "data", fileName: "\(Date().timeIntervalSince1970).jpg", mimeType: "image/jpg") multipartFormData.append(operaID.data, withName: "id") }, to: URL_CORDINATE) { (result) in switch result { case .success(let upload, _, _): upload.uploadProgress(closure: { (progress) in print("Upload Progress: \(progress.fractionCompleted)") }) upload.responseJSON { response in print("Upload image response:", response.result.value) } case .failure(let encodingError): print("Error while uploading image:", encodingError) } I'm expecting to see the image upload, however there seems to be something wrong with the body (I should pass the img and id in the body not as parameters!)
It does however work in Postman: https://i.sstatic.net/f0mUd.png