14
votes

How can I set the session timeout using ASIHTTPRequest ?

Thanks

2
Just as an FYI, the author of ASIHTTPRequest has officially stopped supporting it, and hasn't even used it himself in awhile. You can read all about it at his blog. Another great async HTTP library is AFNetworking, written by the Gowalla dev team.Evan Davis

2 Answers

39
votes

You can set the default timeout for ASIHttpRequest by using:

    [ASIHTTPRequest setDefaultTimeOutSeconds:20];

Is that what your looking for?

17
votes

Given an instance of ASIHttpRequest, you can use

asiRequest.timeOutSeconds = 20;

This is useful if you only want to change the timeout from the default for one request.