iOS - Increase timeout for AFHTTPRequestOperationManager

后端 未结 5 936
被撕碎了的回忆
被撕碎了的回忆 2021-02-04 09:11

I\'m downloading JSON data from a very slow server. It takes about a minute to get a resoonse from the server. I use AFNetworking library and my code throws \"The request timed

5条回答
  •  迷失自我
    2021-02-04 10:10

    I'm a bit lazy to categorize or subclass. You can access the manager's request serializer directly:

    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    manager.requestSerializer.timeoutInterval = INTERNET_TIMEOUT;
    manager.requestSerializer.cachePolicy = NSURLRequestReloadIgnoringLocalAndRemoteCacheData;
    

提交回复
热议问题