I'm facing the following problem, I'm trying to use Alamofire to access to a few Web services in my application, this is the code that i'm using:
Alamofire.request(.GET, "https://httpbin.org/get")
.validate()
.responseJSON { response in
switch response.result {
case .Success:
print("Validation Successful")
case .Failure(let error):
print(error)
}
}
the result for this is "Validation Successful" and this is right, but the problem is when i'm trying to call my own service this is the url of the web service if anyone want to check it out: https://ratid.com/RapidSentry/MiOSService.svc/GetUserIdentity... This web service is working fine as you could see, but when i'm calling the same code but with my url i got the following error:
Error Domain=com.alamofire.error Code=-6003 "Response status code was unacceptable: 500" UserInfo={NSLocalizedFailureReason=Response status code was unacceptable: 500}
I'm using already this web service in an android application and work fine with the GET request Please i'll appreciate any help with this issue. Note: I'm using Xcode 7 and swift.
Pass the acceptable range of status codes in to the validate function like this :
.validate(statusCode: 200..<500)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With