在做某些特殊行业应用时会遇到图片或者文章防盗链问题,可在request中加如Referer头+服务器地址
例如:NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url cachePolicy: NSURLRequestUseProtocolCachePolicy timeoutInterval:10];
[theRequest addVaule:@"192.168.1.1" forHTTPHeaderField:@"Referer"];
或:
ASIHTTPRequest *asrequest=[ASIHTTPRequest requestWithURL:url];
[asrequest addRequestHeader:@"Referer" value:@"192.168.1.1"];
原文地址:http://blog.csdn.net/hxl188/article/details/38964099