JSON-RPC client for iOS, based on AFNetworking
Switch branches/tags
Nothing to show
Pull request Compare This branch is 12 commits behind wiistriker:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
AFJSONRPCClient.h
AFJSONRPCClient.m
README.markdown

README.markdown

Simple JSON-RPC Client based on top of AFNetworking (https://github.com/AFNetworking/AFNetworking)

http://json-rpc.org/

Example Usage

AFJSONRPCClient *client = [[AFJSONRPCClient alloc] initWithURL:[NSURL URLWithString:@"http://path.to/json-rpc/service/"]];

[client invokeWithMethod:@"method.name" success:^(AFHTTPRequestOperation *operation, id responseObject) {
    //success handling
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    //error handling
}];

[client invokeWithMethod:@"method.name" parameters:[NSArray arrayWithObjects:@"1", @"2", nil] success:^(AFHTTPRequestOperation *operation, id responseObject) {
    //success handling
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    //error handling
}];

[client invokeWithMethod:@"method.name" parameters:[NSArray arrayWithObject:@"1"] withRequestId:@"2" success:^(AFHTTPRequestOperation *operation, id responseObject) {
    //success handling
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    //error handling
}];