Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LYWebService

an weak coupling and convenient network request util based on AFNetworking. could support auto Params and Data Parser,auto create reuqest. also support flexible custom Parser settings...

Requirements

AFNetworking

Installation with Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

Then update dependents :

$ sh update.sh

Usage

configure LYWebClient

LYWebClientInstance.endPoint = [NSURL URLWithString:@"http://route.showapi.com"];
[LYWebClientInstance setPublicParams:[[LYPublicParamsDefault alloc] init]];
...    

Creating API

@protocol LYTextApi <LYWebService>

@GET("/967-1")
- (NSURLSessionDataTask*)getInfo:(NSString *)showapi_appid
                    suceessBlock:LY_SUCCESS_BLOCK(NSArray<LYTextModel *> *)callback
failBlock:LY_FAIL_BLOCK(NSString*)errorMessage;

@end

do task

[LYWebRequest(LYTextApi) getInfo:@"my_appSecret" suceessBlock:^(NSArray *result, NSURLResponse *response) {
        NSLog(@"LYWebRequest Suceess");
    } failBlock:^(NSString *errorMessage, NSURLResponse *response, NSError *error) {
        NSLog(@"LYWebRequest fail");
    }];

@end

About

an convenient network request util based on AFNetworking

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.