有没有办法重试ASIHTTPRequest?我在REST服务中使用自定义身份验证而不是基本HTTP身份验证,如果会话已过期,我想重试请求.在请求上第二次调用startAsynchronous会导致异常.我想做这样的事情:
[request setCompletionBlock:^{
if ([request responseStatusCode] == 500)
{
// try to login again in case token expired
[server loginAndRetryRequest:request];
} else {
// parse response
}
}];
Run Code Online (Sandbox Code Playgroud)
loginAndRetryRequest:将执行另一个ASIHTTPRequest登录,当它完成时,它将从它的CompletionBlock再次启动原始请求(假设这可能以某种方式)?