Afnetwoworking Network Request time settings
Objective:
The Afnetwoworking network request framework was recently used.
If you want to study hard please download the document (Chinese + English) bilingual: Document Download
We may do this: when calling Afhttprequestoperationmanager's Get and POST methods, the network request time is 60 seconds, just as I would think the time is a bit long, I want to change to 10 seconds;
Method:
1. First we find the afurlrequestserialization.m file
2. Then find the following function:
-(Nsmutableurlrequest *) Requestwithmethod: (NSString *) method urlstring: (NSString *) urlstring parameters: ( ID) Parameters Error: (nserror *__autoreleasing *) error
3. In the function:
Nsmutableurlrequest *mutablerequest = [[Nsmutableurlrequest alloc] initwithurl:url];
Switch
Nsmutableurlrequest *mutablerequest = [[Nsmutableurlrequest alloc] Initwithurl:url cachepolicy: Nsurlrequestuseprotocolcachepolicy Timeoutinterval:10];
(Network request time setting after parameter timeOutInterval unit is seconds)
0k;
Afnetwoworking Network request time settings