什么是连接超时的情况下的iPhone手机。在请求完成后编译器等待响应多久?连接超时在iPhone为http请求
2
A
回答
4
使用NSURLConnection,在NSURLRequest中设置超时,并且NSMutableURLRequest请求中的默认值为60秒,并且可以使用setTimeoutInterval方法更改。
2
的默认请求超时为60秒,但你可以改变它的任何的URLRequest。在本例中,我通过调用setTimeoutInterval将NSMutableURLRequest的超时设置为15秒:
NSURL *url = [[NSURL alloc] initWithString:@"http://someurl.com"];
NSMutableURLRequest *urlRequest = [[NSMutableURLRequest alloc] initWithURL:url];
[urlRequest setTimeoutInterval:15.0];
NSError *error;
NSURLResponse *response;
NSData *data = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:&response error:&error];
相关问题
- 1. Oracle连接请求超时
- 2. ODP.NET连接请求超时
- 3. HTTP请求超时
- 4. 高峰时段RDS连接超时(约50,000个HTTP请求)
- 5. HTTP,408请求超时
- 6. 超时http请求? Android
- 7. Http请求超时问题
- 8. 去HTTP请求超时
- 9. Express.js HTTP请求超时
- 10. Node.js 0.4.10。 http get()请求“ETIMEDOUT连接超时”频繁
- 11. WARN - SourceHandler读取请求后连接超时:http-incoming-
- 12. Oracle ManagedDataAccess - 连接请求超时 - 合并
- 13. HTTP请求 - 已连接
- 14. 为什么我的网络服务请求在3G连接上超时? iphone
- 15. Alamofire请求总是失败,如果Socket.io连接“请求超时”
- 16. perl LWP:连接超时与请求超时不同
- 17. 请求超时 - 请求超时
- 18. 在http请求中设置基于套接字的超时
- 19. SimpleClientHttpRequestFactory与HttpComponentsClientHttpRequestFactory的Http请求超时RestTemplate?
- 20. http发布请求中的Angular2超时
- 21. firefox addon-sdk:处理http请求超时
- 22. HTTP请求的可靠JRuby超时
- 23. 错误超时得到HTTP请求golang
- 24. NodeJS http post请求读取超时
- 25. C#HTTP Web请求保持超时
- 26. ESP8266 CIPSEND GET HTTP主机请求超时
- 27. 对http请求的响应超时
- 28. 即使连接超时和读取超时设置为默认(无限),接收请求超时?
- 29. Go - HTTP请求,JSON,重用连接
- 30. CometChat请求过多的HTTP连接