首页 新闻 会员 周边

ASI 请求 网络超时 怎么处理

0
悬赏园豆:5 [待解决问题]

error 超时处理是返回为空的为什么 

    ASI
NSURL *url = [NSURL URLWithString:_URL];
ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:url];
[request setDelegate:self];
[request appendPostData:[param dataUsingEncoding:NSUTF8StringEncoding]];
[request setRequestMethod:@"PUT"];
[request setTimeOutSeconds:30];//设置超时 

[request startSynchronous];

NSError *error = [request error];//error 超时处理是返回为空的为什么
if (error)
{
DLog("%@",error);
NSException * tException=[NSException exceptionWithName:@"网络连接失败" reason:[error domain] userInfo:[error userInfo]];
@throw tException;
}

zander的主页 zander | 初学一级 | 园豆:162
提问于:2013-07-19 11:40
< >
分享
所有回答(2)
0

[request setRequestMethod:@"PUT"];你确定是吗   put还有时间

采采00 | 园豆:220 (菜鸟二级) | 2013-07-20 17:29
0

这个问题  看asi问题日志吧!
一点提示没有不应该呀  你打印下error,先!

看谷秀 | 园豆:218 (菜鸟二级) | 2016-03-30 19:07
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册