httpriot

8/07/2010

Today I tested httpriot a simple REST library designed to make interacting with REST services on iOS much easier.

It’s pretty simple and works with JSON and XML.

Some Examples:
Send a GET request:
[HRRestModel getPath:@"/person.json" withOptions:nil object:nil];
Send a POST request with JSON body data:
NSDictionary *opts = [NSDictionary dictionaroyWithObject:[person JSONRepresentation] forKey:@"body"];
[HRRestModel postPath:@"/person" withOptions:opts object:nil];
Send a PUT request:
NSDictionary *opts = [NSDictionary dictionaroyWithObject:[updatedPerson JSONRepresentation] forKey:@"body"];
[HRRestModel putPath:@"/person" withOptions:opts object:nil];
Send a DELETE request:
[HRRestModel deletePath:@"/person/1" withOptions:nil object:nil]

No comments yet.

Write a comment:

You have to log in to write a comment.