dongliyi967823 2014-02-04 18:33
浏览 89
已采纳

想法为什么AFJSONRequestOperation JSONRequestOperationWithRequest:返回408 - 超时

Any ideas why an JSONRequestOperationWithRequest would return a 408 on a very quick JSON pull, and yet if you hit the same code again it returns normally?

This is happening in an app I've written where the first time you hit it, I get a 408 but then if I hit it again all is fine. I can then close the app and try it again and it works fine.

However if I wait 30 min or so and try it again, the initial call returns a 408 the first time, yet every time after that is returns fine. Thoughts?

dump of NSError (url has been masked in this paste)

    Error Domain=AFNetworkingErrorDomain Code=-1011 "Expected status code in (200-299), got 408" UserInfo=0x11c44f70 {NSLocalizedRecoverySuggestion=Your request timed out. Please retry the request. , AFNetworkingOperationFailingURLRequestErrorKey= { URL: http://www.xxxxxxxxxx.php }, NSErrorFailingURLKey=http://www.xxxxxxxxxx.php, NSLocalizedDescription=Expected status code in (200-299), got 408, AFNetworkingOperationFailingURLResponseErrorKey= { URL: http://www.xxxxxxxxxx.php } { status code: 408, headers {
    "Cache-Control" = "no-cache";
    Connection = close;
    "Content-Length" = 514;
    "Content-Type" = "text/html";
    Pragma = "no-cache";
    } }}
  • 写回答

1条回答 默认 最新

  • dousong8187 2014-02-04 19:02
    关注

    sounds like it is something on the server end. A 408 is where the server is responds to it taking to long for a request. I am almost positive it isn't what you are doing on the app side as you try it again and it works... You will have to look into the server side, wish I could be more help.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码