在 restkit 0.20.0 中请求超时 [英] Request timeout in restkit 0.20.0
本文介绍了在 restkit 0.20.0 中请求超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我没有找到在 restkit 0.20.0 上设置超时间隔的任何方法.
I didn't find any way to set the timeout interval on restkit 0.20.0.
谁能帮忙增加超时间隔.
Can anyone help to increase the timeout interval.
谢谢
推荐答案
子类RKHTTPRequestOperation和实现方法
Subclass RKHTTPRequestOperation and implement method
- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse
{
NSMutableURLRequest *requestWithTimeout = [request mutableCopy];
[requestWithTimeout setTimeoutInterval:30];
return [super connection:connection willSendRequest:requestWithTimeout redirectResponse:redirectResponse];
}
这篇关于在 restkit 0.20.0 中请求超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文