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...
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
LYWebClientInstance.endPoint = [NSURL URLWithString:@"http://route.showapi.com"];
[LYWebClientInstance setPublicParams:[[LYPublicParamsDefault alloc] init]];
...
@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
[LYWebRequest(LYTextApi) getInfo:@"my_appSecret" suceessBlock:^(NSArray *result, NSURLResponse *response) {
NSLog(@"LYWebRequest Suceess");
} failBlock:^(NSString *errorMessage, NSURLResponse *response, NSError *error) {
NSLog(@"LYWebRequest fail");
}];
@end