AFNetworking - HTTP loading error (error code: -999) swift iOS

I use AFNetworking with iOS 11. I get an error, for example:

Task <2EC9C49F-1889-4BFF-83B4-2047ED6E5F2A>. <1> Error loading HTTP (error code: -999 [1:89]) Error (countries.php): Domain error = NSURLErrorDomain Code = -999 "canceled" UserInfo = {NSErrorFailingURLStringKey = https://www.plrc.us /api/countries.php , NSLocalizedDescription = canceled, NSErrorFailingURLKey = https://www.plrc.us/api/countries.php }

I have tried my best.

info.plist

Please help me solve this problem.

thank

+4
source share
1 answer

, , :

  • NSExceptionAllowsInsecureHTTPLoads , .

  • - JSON, Content-Type text/html. AFNetworking ( Swifty sibling, Alamofire) HTTP Content-Type.

    AFNetworking , , , text/html AFJSONResponseSerializer. ( AFHTTPResponseSerializer, JSON.)

, , NSURLErrorCancelled. - iOS, "" ( plist, - , ).

, - . , . ( .) , , Wi-Fi. ( , , -, .)

AFNetworking NSURLSessionAuthChallengeCancelAuthenticationChallenge URLSession:didReceiveChallenge:completionHandler:, NSURLErrorCancelled. . - , AFURLSessionManager.

, Charles Charles Root, "" . , , SSL, "" "SSL Proxying "" " iOS"). , ( ), , , AFNetworking , NSURLErrorCancelled.

, , , , , , , .

+1

Source: https://habr.com/ru/post/1686499/


All Articles