nst / STHTTPRequest

Obj-C / Cocoa HTTP requests for humans
BSD 3-Clause "New" or "Revised" License
826 stars 75 forks source link

Timeout setting doesn't work #37

Open shawnmorrison opened 8 years ago

shawnmorrison commented 8 years ago

As of the change that updated STHTTPRequest to use NSURLSession setting the timeout via setTimeoutInSeconds: does not work.

It seems that setting timeoutInterval on NSURLRequest is not respected by NSURLSession. Instead it seems setting timeoutIntervalForRequest or timeoutIntervalForResource on NSURLSessionConfiguration is necessary instead.

Also note: it seems that if a background session configuration is used then timeoutIntervalForResource is the only timeout that is respected.

This is very easy to test and confirm but for reference I was tipped off by this SO post.

IngenicoNPSLatam commented 6 years ago

Someboyd knows if it's gonna be solve? @shawnmorrison can u tell me how did u solve this problem?