Objective-c Send Post request to json-RPC webservice
NickName:Dr. chamran Ask DateTime:2015-05-09T13:45:27

Objective-c Send Post request to json-RPC webservice

In iOS i want send a POST request to a json-RPC web service. How can i do this? i read This Page before and this repo but none of them have helped me.

Copyright Notice:Content Author:「Dr. chamran」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/30136495/objective-c-send-post-request-to-json-rpc-webservice

Answers
Michael 2015-05-09T06:02:19

Take a look at the popular AFNetworking networking library. This provides full networking functionality and very well documented code. Although you can also use Apple's networking APIs for this.\n\nSimple AFNetworking example:\n\nAFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];\nmanager.requestSerializer = [AFJSONRequestSerializer serializer];\n\nNSDictionary *params = @{@\"q\":@\"Chicago\",\n @\"units\":@\"imperial\",\n @\"type\":@\"like\",\n @\"mode\":@\"json\"\n };\n\n [manager GET:@\"http://api.openweathermap.org/data/2.5/weather\" parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {\n\n //Success\n\n } failure:^(AFHTTPRequestOperation *operation, NSError *error) {\n\n //Failure\n\n }];\n",


More about “Objective-c Send Post request to json-RPC webservice” related questions

Objective-c Send Post request to json-RPC webservice

In iOS i want send a POST request to a json-RPC web service. How can i do this? i read This Page before and this repo but none of them have helped me.

Show Detail

Could I use JSON-RPC to POST a file to a webservice?

I'm looking for viable webservice solution and I just found JSON-RPC which is seducing and seems lightweight (over XML or SOAP for example). But I'm wondering if I'll be able to post binary DATA u...

Show Detail

How to get data from a json-rpc webservice : iPad /iPhone / Objective C

I'am working on a iPad project and this project needs to talk to a json-rpc webservices. The webservices is based on Drupal with module : cck and views 1)I need to push a json object into the

Show Detail

NodeJS POST Request Over JSON-RPC

I am trying to execute a POST request over JSON-RPC on my NodeJS server. Converting the following curl command: curl -X POST --data '{"jsonrpc":"2.0","method":"personal_newAccount","params":[

Show Detail

Soap webservice request vs HTTP POST request?

I am coming from servlet/web application world and started learning web services(SOAP based). I have gone through some of the webservice tutorials. I am trying to draw the parallel between normal...

Show Detail

ASP.NET : sending a soap request in a HTTP post request to a webservice

I have a webservice that exposes a function called ADD(int a, int b) and i am trying to send a request to it without adding a wsdl/reference and then calling the function, In other words, i want to

Show Detail

Objective-C JSON-RPC Request issue

I have a problem with my JSON-RPC query. NSString *jsonString = @"{id:1,method:getHolidays,jsonrpc:2.0}"; NSString *requestString = [NSString stringWithFormat:@"%@",jsonString,nil]; NSData *reque...

Show Detail

POST request in Objective-C

Searching the web for some method to send POST requests in Objective-C, I came up with some solutions. That's what I've got: responseData = [NSMutableData new]; NSURL *url = [NSURL URLWithString:...

Show Detail

When is JSON-RPC over http with POST more suitable than RESTful API?

I'm currently developing a web application with a senior developer. We've agreed to use REST API for client-server communication and he sent me the parameters and the expected responses. But the d...

Show Detail

How to respond to HTTP OPTIONS request on a JSON-RPC server

My JSON-RPC client (browser using dojo JSON-RPC) makes a JSON-RPC request (dojo.callRemote) to my JSON-RPC server on myserver.com/12345 (Python 2.5, SimpleJSONRPCServer). The server then gets a H...

Show Detail