[ad_1]
I’ve built-in api like this and server return “Sudden quantity in JSON at place 1” error repeatedly , what can I do to repair it ? it’s working nice on postman
let headers: HTTPHeaders = ["nonce":"(UserDefaults.standard.string(forKey: "nonce")!)","signature":"(signature)","publickey":"(UserDefaults.standard.string(forKey: "publickey")!)","action":"uploadCollectionImage"]
AF.add(multipartFormData: { multiPart in
let timestamp = NSDate().timeIntervalSince1970
multiPart.append(imgData, withName: "file",fileName: "new-001",mimeType: "picture/jpeg")
}, to: "https://pri65iunr6.execute-api.us-east-1.amazonaws.com/Prod/uploadArtwork",technique: .submit,headers: headers ).responseJSON { apiResponse in
change apiResponse.end result{
case .success(_):
let apiDictionary = apiResponse.worth as? [String:Any]
print("apiResponse --- (apiDictionary)")
case .failure(_):
print("obtained an error")
}
}
[ad_2]
