iOS http封装

程序开发避免不了与服务器的交互,这里打包了一个自己写的http交互库。希望可以帮到大家。

内置一个basehttp,当我们创建自己的service可以继承实现。

KuroAppBaseHttp *baseHttp = [[KuroAppBaseHttp alloc] init];

[baseHttp setDelegate:self];

[baseHttp loadHttp:@"http://www.baidu.com" withKey:@"baidu" withData:nil withMethod:KURO_HTTP_METHOD_GET];

 

回调函数:

- (void)didAppHttpComplate:(id)aObj withKey:(NSString *)aKey

{

    NSLog(@"akey %@   aobj %@",aKey, aObj);

}

 

- (void)didAppHttpComplateError:(id)aObj withKey:(NSString *)aKey

{

    NSLog(@"akey %@   aobj %@",aKey, aObj);

 

}

猜你喜欢

转载自374016526.iteye.com/blog/2227260
今日推荐