Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Suggestions for setting timeout #7

Open
robreuss opened this Issue Mar 27, 2013 · 1 comment

Comments

Projects
None yet
2 participants

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!

Owner

wiistriker commented Mar 29, 2013

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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment