SwiftHTTP
SwiftHTTP copied to clipboard
Cannot upload file
Hey,
I'm trying to upload a file as follows:
guard let imageData = UIImageJPEGRepresentation(image) else { return }
let headers = ["Authorization": Data.accessToken, "Content-Type": "multipart/form-data", "Accept": "application/vnd.api+json"]
let parameters: [String: Any] = [
"file": Upload(data: imageData, fileName: "img", mimeType: "image/jpeg")
]
HTTP.POST("my-url...", parameters: parameters, headers: headers, completionHandler: completion)
... but the backend doesn't receive the image.
May this be caused by the library? Does it work for anyone else?