0
Ich bekomme INPUT_VALIDATION_ERROR beim Einloggen in Betfair API. Ich folge den Dokumenten, aber es war nutzlos mit diesem speziellen Fehlercode.INPUT_VALIDATION_ERROR in BetFair Anmeldung API/iOS
Ich würde mich freuen, wenn jemand mich in die richtige Richtung führen könnte.
Hier ist mein SWIFT-Code
let request = NSMutableURLRequest(URL: NSURL(string: "https://identitysso.betfair.com/api/login")!)
request.HTTPMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Accept")
request.setValue("MY_APP_KEY", forHTTPHeaderField: "X-Application")
let postString = "username=MY_USER_NAME&password=MY_PASSWORD"
request.HTTPBody = postString.dataUsingEncoding(NSUTF8StringEncoding)
let task = NSURLSession.sharedSession().dataTaskWithRequest(request) { data, response, error in
guard error == nil && data != nil else { // check for fundamental networking error
print("error=\(error)")
return
}
if let httpStatus = response as? NSHTTPURLResponse where httpStatus.statusCode != 200 { // check for http errors
print("statusCode should be 200, but is \(httpStatus.statusCode)")
print("response = \(response)")
}
let responseString = NSString(data: data!, encoding: NSUTF8StringEncoding)
print("responseString = \(responseString)")
}
task.resume()
Es funktioniert für mich! – Klevison
Cool, es hat für dich funktioniert – sendon1982