How to access the REST API on iPhone?

So, I'm new to the leisure API and have never used an API before. I am fine with Objective-C and Cocoa Touch, but I just don’t know where to start when I access the API and how. Can someone help me start with some code that will have access to the credits alone or just access the REST API as a whole through authentication. Thank.

+3
source share
3 answers
+1
source

Take a look at RestKit: http://restkit.org/

, RESTful , .

+1

http://github.com/mirek/NSMutableDictionary-REST.framework is easy to use.

To get REST as a dictionary from the GitHub API as an example:

NSString *url = @"http://github.com/api/v2/xml/user/search/mirek";
[NSMutableDictionary dictionaryWithRESTContentsOfURL: url];

Send a message:

[myDict postRESTWithURL: @"http://localhost:3000/my-rest"];

It supports sync / async, intuitive array conversions, url encoded and multipart messages (you can send images and other files).

0
source

Source: https://habr.com/ru/post/1742459/


All Articles