GGRest 0.1.19

GGRest 0.1.19

TestsTested
LangLanguage Obj-CObjective C
License Apache 2
ReleasedLast Release Mar 2016

Maintained by GreenGrowApps.



GGRest 0.1.19

  • By
  • Adri

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Example

This example gets the content of the url using basic http auth and deserializes the content as an object:

    GGWs *ws=[[GGWs alloc] init];
    ws.url=@"https://api.github.com/repos/greengrowapps/GGRest/commits";
    ws.method=GET;
    ws.authentication=[[GGHttpBasicAuth alloc] initWithUsername:@"YOUR_GITHUB_USER" andPassword:@"YOUR_GITHUB_PASSWD"];

    ws.onOkArray=^(NSArray *commitsList ,GGGitCommit *nill ){
        for(GGGitCommit *c in commitsList){
          NSLog(@"Commit: %@",c);
        }
    };

    ws.onError=^(GGHttpResponse *response,NSError *error){
         NSLog(@"Unknown error");
    };

    [ws onResponse:404 objectCallBack:^(GGHttpResponse *res){
        NSLog(@"Repo not found");
    }];

    [ws onResponse:401 objectCallBack:^(GGHttpResponse *res){
        NSLog(@"Invalid credentials");
    }];


    [ws execute];

Installation

GGRest is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "GGRest"

License

GGRest is available under the Apache License Version 2.0. See the LICENSE file for more info.