Aşağıdaki kod iOS9'da düzgün çalışıyor ancak iOS8'de çalıştırdığınızda başarısız oluyor ve Amazon 400 hatası veriyor. :PUT NSData Öntanımlı URL S3 with Alamofire.upload (...) iOS 8 üzerinde çalışmıyor
- Bağlantı = close; "İçerik Türü" = "uygulama/xml"; Tarih = "Çar, 13 Nis 2016 12:19:21 GMT"; Sunucu = AmazonS3; ...
NSData bir resim ve İçerik Türü, "ikili/okt-akışı" olarak saklanmamasını söyleyen "image/png" şeklindedir. cevaba bana rehberlik
func uploadFile(locationURL: String, http: Alamofire.Method, mimeType: String, fileData: NSData) -> ApiCaller {
Alamofire.upload(http, locationURL, headers: ["Content-Type": mimeType], data: fileData)
.progress { bytesWritten, totalBytesWritten, totalBytesExpectedToWrite in
if let uploadProgress = self.uploadProgress {
uploadProgress(bytesWritten, totalBytesWritten, totalBytesWritten);
}
}
.response { (req, res, json, error) in
self.returnResult(req, res: res, json: json, error: error, tag: 0)
return();
}
return self;
}
, mevcut yazım 'Alamofire.SessionManager.default.session.configuration.httpAdditionalHeaders = olduğunu [:] ' – Guig