摘要:
代码如下:NSString *strUrl=[textField text];NSString *urlString=[NSString stringWithFormat:strUrl];NSURL *url=[NSURL URLWithString:urlString];NSURLRequest *urlRequest=[NSURLRequest requestWithURL:urlcachePolicy:NSURLRequestReturnCacheDataElseLoadtimeoutInterval:60];NSData *urlData;NSURLResponse *response 阅读全文
摘要:
同步访问时的取法 NSURL *url = [NSURL URLWithString:@"http://www.test.com"]; NSURLRequest *request = [NSURLRequest requestWithURL: url]; NSHTTPURLResponse *response; [NSURLConnection sendSynchronousReque... 阅读全文
摘要:
完整版的iphone(XCODE),oc http上传请求协议,一个完整的DEMO,提供给大家学习//保存图片-(void)saveImage{_alertview=[[UIAlertViewalloc]initWithTitle:nilmessage:@"正在上传照片..." delegate:selfcancelButtonTitle:nilotherButtonTitles... 阅读全文
摘要:
转载于:http://blog.sina.com.cn/s/blog_661314940100m648.html最近坐了一个项目涉及到图片上传的问题,起初用到socket,但是由于比较陌生改而用 http 协议做web上传这里需要自定义http协议 http协议应该注意四点: 1.初始化响应服务器地址NSURL *url = [NSURLURLWithString:@"http://x... 阅读全文
摘要:
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; NSLog(@"Load currentCookie:%@", cookie); [request s... 阅读全文