AFNetwork-JSON-RPC-Client
AFNetwork-JSON-RPC-Client copied to clipboard
Suggestions for setting timeout
Hi -
Any suggestions for modifying time-out value for requests? Since no NSMutableRequest is sent into the methods, the normal way of modifying timeout with AFNetworking doesn't seem practical.
Thanks!
Hi!
You can use this method https://github.com/AFNetworking/AFJSONRPCClient/blob/master/AFJSONRPCClient/AFJSONRPCClient.m#L88
Just extend it in your own client class and do something like:
- (NSMutableURLRequest *)requestWithMethod:(NSString *)method
parameters:(id)parameters
requestId:(id)requestId
{
...
NSMutableURLRequest *request = [self requestWithMethod:@"POST" path:[self.endpointURL absoluteString] parameters:payload];
[request setTimeoutInterval:...];
return request;
}