ASIHTTPRequest类库是基于ISO SDK的一组网络请求的API。IOS SDK的网络组件CFNetwork API操作起来非常复杂。而ASIHTTPRequest类库是对CFNetwork API的封装,提供了基于HTTP请求的各类操作接口。
NSURL *url = [NSURL URLWithString:@"http://www.tekuba.net"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request startSynchronous];//简单的测试,这里使用同步传输,程序会一直等待请求完成 NSError *error = [request error]; if (!error) { NSString *response = [request responseString];//如果请求成功,则返回的数据会存储在response指向的内存中 }
ASIHTTPRequest的环境配置和使用示例,布布扣,bubuko.com
原文:http://www.cnblogs.com/langtianya/p/3889129.html