/ZZHttpModel

Primary LanguageObjective-CMIT LicenseMIT

ZZHttmModel

安装使用

pod 'httpmodel', '~> 0.0.1'

使用说明

NSString *url = @"http://www.kuaidi100.com/query?type=yuantong&postid=11111111111"; ZZHttpModel *model = [[ZZHttpModel alloc]initWithMethod:@"POST"]; [model pullData:url withParams:nil requestBlock:^(NSMutableURLRequest *request) { [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; [request setValue:@"text/javascript" forHTTPHeaderField:@"Accept"]; } withCompletionBlock:^(ZZHTTPResponse *response) { NSLog(@"%@",response);

KuaidiModel *kuaidi = [[KuaidiModel alloc]initWithDictionary:response.data]; NSLog(@"%@",[kuaidi toDictionary]); }];

返回response对象

github

Dictionary => Model

github

Model => Dictionary

github

Model => JSON

github github