NSURLRequest

来源:互联网 发布:桌面数据恢复软件 编辑:程序博客网 时间:2024/05/02 04:51
//获取网页html        NSURL* url = [NSURL URLWithString:@"http://www.baidu.com"];        NSMutableURLRequest* request = [NSMutableURLRequest new];        [request setURL:url];        [request setHTTPMethod:@"GET"];        NSURLRequest* response;        NSData* data = [NSURLConnection sendSynchronousRequest:request                                             returningResponse:&response error:nil];        NSString* strRet = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];         NSLog(strRet);             [strRet release];
原创粉丝点击