ios (200-299) 中的预期状态代码得到 503
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23807162/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
expected status code in (200-299) got 503
提问by user3400046
I got the following error expected status code in (200-299) got 503.
我在 (200-299) 中收到以下错误预期状态代码得到 503。
I didn't get this all the time. Sometimes I notice this error. I am unable to figure out the exact reason.
我一直没有得到这个。有时我会注意到这个错误。我无法弄清楚确切原因。
The base URL I am using in the application is in following format.
我在应用程序中使用的基本 URL 采用以下格式。
BaseURL: https://staging.something.com
BaseURL:https://staging.something.com
For every request I append to base url as follows.
对于每个请求,我按如下方式附加到基本 url。
"BaseURL/api/"
"BaseURL/api/"
Please let me know if any issues.
如果有任何问题,请告诉我。
回答by Chris Lear
503 means service unavailable. Lots of servers give that for lots of reasons.
503 表示服务不可用。许多服务器出于多种原因给出了这一点。
2xx means that something normal happened
2xx 表示发生了正常的事情
回答by Michael Dautermann
503 means "Service Unavailable".
503 的意思是“服务不可用”。
Which means there is a problem on the server side.
这意味着服务器端存在问题。
Make certain that the URL you are connecting to looks like a valid URL. For example, you can do something like:
确保您要连接的 URL 看起来像一个有效的 URL。例如,您可以执行以下操作:
NSLog(@"the url I am connecting to is %@", [myURL absoluteString]);
And see if it matches what you were expecting: https://staging.something.com/api/
.
看看它是否符合您的预期: https://staging.something.com/api/
.
If it looks really wrong, like "apihttps://staging.something.com
", then it's something that you can easily fix.
如果它看起来真的是错误的,比如“ apihttps://staging.something.com
”,那么你可以很容易地修复它。
If you are getting this problem all the time, you should probably reach out to the owner of the service you're trying to use and ask them for assistance.
如果您一直遇到此问题,您可能应该联系您尝试使用的服务的所有者并向他们寻求帮助。