Latest 0.0.1
Homepage https://github.com/yellowzhou/ZZHttmModel
License MIT
Platforms ios 8.0, requires ARC
Dependencies AFNetworking
Frameworks CFNetwork, Foundation
Authors

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

Latest podspec

{
    "name": "httpmodel",
    "platforms": {
        "ios": "8.0"
    },
    "version": "0.0.1",
    "summary": "Dictionary <=> Model <=> JSON",
    "homepage": "https://github.com/yellowzhou/ZZHttmModel",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "yellowzhou": "[email protected]"
    },
    "source": {
        "git": "https://github.com/yellowzhou/ZZHttmModel.git",
        "tag": "0.0.1"
    },
    "frameworks": [
        "CFNetwork",
        "Foundation"
    ],
    "source_files": "ZZHttpModel/Src/*.{h,m}",
    "requires_arc": true,
    "dependencies": {
        "AFNetworking": []
    }
}

Pin It on Pinterest

Share This