14

How can I set the session timeout using ASIHTTPRequest ?

Thanks

Dave
  • 363
  • 2
  • 3
  • 9
  • 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](http://allseeing-i.com/). Another great async HTTP library is [AFNetworking](https://github.com/gowalla/AFNetworking), written by the Gowalla dev team. – Evan Davis Sep 28 '11 at 21:06

2 Answers2

40

You can set the default timeout for ASIHttpRequest by using:

    [ASIHTTPRequest setDefaultTimeOutSeconds:20];

Is that what your looking for?

user229044
  • 232,980
  • 40
  • 330
  • 338
jpoz
  • 2,257
  • 1
  • 23
  • 29
18

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.

Stephen Booher
  • 6,522
  • 4
  • 34
  • 50