摘要: ASI的缓存是ASI的一大特色,和苹果原生的NSURLCache一样,也提供了一个单例对象[ASIDownloadCache sharedCache]1.ASI使用缓存的条件1>必须是GET请求2>请求成功,状态码是2002.单个请求怎么使用ASI缓存 // 设置URL NSURL *url = ... 阅读全文
posted @ 2015-01-26 22:16 oumygade 阅读(455) 评论(0) 推荐(0) 编辑
摘要: // 监控整个项目,是否有请求正在进行BOOL flag = [ASIHTTPRequest isNetWorkInUse];// 整个项目,显示或隐藏运营商右边的指示器[ASIHTTPRequest setShouldUpdateNetWorkActivityIndicator:YES]// 针对... 阅读全文
posted @ 2015-01-26 19:38 oumygade 阅读(155) 评论(0) 推荐(0) 编辑
摘要: ASIHTTPRequest继承自NSOperation,这样就可以把多个请求放在一个队列中,这样便于管理多个请求 ASIHTTPRequest *request1 = [[ASIHTTPRequest alloc]init]; ASIHTTPRequest *request2 = [[ASIHT... 阅读全文
posted @ 2015-01-26 19:28 oumygade 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 1.文件上传的示例代码 // 设置url NSURL *url = [NSURL URLWithString:@"http://localhost/photo"]; // 设置请求 self.postRequest = [ASIFormDataRequest requestWithURL:ur... 阅读全文
posted @ 2015-01-26 19:11 oumygade 阅读(449) 评论(0) 推荐(0) 编辑
摘要: 1.方法一:如果NSData数据很大,把很大的数据装进内存,内存肯定会爆掉,所以这种方法不可取 // 设置url NSURL *url = [NSURL URLWithString:@"http://localhost/123.jpg"]; // 设置请求 self.request = [AS... 阅读全文
posted @ 2015-01-26 09:37 oumygade 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 发POST请求,需要用到专门的类:#import "ASI/ASIFormDataRequest.h"示例代码: // 设置url NSURL *url = [NSURL URLWithString:@"http://api.openweathermap.org/data/2.5/weather"... 阅读全文
posted @ 2015-01-26 01:24 oumygade 阅读(267) 评论(0) 推荐(0) 编辑