在AFNetworking中找不到具有指定主机名的服务器 [英] A server with the specified hostname could not be found in AFNetworking
问题描述
我在我的应用中从 ASIHTTPRequest
转出 AFnetworking
API,以解决连接错误问题。
I switch out AFnetworking
API from ASIHTTPRequest
in my app for connection error issues.
但现在我在 AFNetworking
中收到连接错误。我该如何解决这个问题?
But now I'm getting connection error in AFNetworking
. How can I resolve this?
Printing description of error: Error Domain=NSURLErrorDomain Code=-1003 "A server with the
specified hostname could not be found." UserInfo=0x1553bab0
{NSErrorFailingURLStringKey=https://example.com/oauth/token,
NSErrorFailingURLKey=https://example.com/oauth/token, NSLocalizedDescription=A server
with the specified hostname could not be found., NSUnderlyingError=0x1553b2c0 "A server
with the specified hostname could not be found."} (lldb)
推荐答案
基本上这是服务器方面的问题。当您的服务器没有响应或您的服务器处于睡眠模式时,会发生此错误。
Basically it's a server side issue. This error occur when your server is not responding or your server looks like in sleep mode.
我也曾多次获取同样的问题。但是,在我的情况下,当我切换到另一个WiFi网络或开关ON / OFF WiFi时,它会自动解决。请尝试,并告诉我们您的意见。
I have also fetch this same issues many time. But, in my case when i switch to another WiFi network or Switch ON/OFF WiFi then it was automatically solved. Please try that and let us know your comments.
谢谢!
这篇关于在AFNetworking中找不到具有指定主机名的服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!