Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions for setting timeout #7

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

Suggestions for setting timeout #7

robreuss opened this issue Mar 27, 2013 · 1 comment

Comments

@robreuss
Copy link

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!

@wiistriker
Copy link
Owner

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants