//1.获取网咯路径
NSString *path = @"http://1.studyios.sinaapp.com/getAllClass.php";
//2.获取URL
NSURL *url = [NSURL URLWithString:path];
//3.创建请求命令
NSURLRequest *urlr = [NSURLRequest requestWithURL:url];
NSURLSession *session = [NSURLSession sharedSession];
//执行绘画的任务 通过request请求获取数据data
NSURLSessionDataTask *dtatt = [session dataTaskWithRequest:urlr completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
NSArray *arrjson = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error];
NSLog(@"%@",arrjson);
}];
//真正执行任务
NSString *path = @"http://1.studyios.sinaapp.com/getAllClass.php";
//2.获取URL
NSURL *url = [NSURL URLWithString:path];
//3.创建请求命令
NSURLRequest *urlr = [NSURLRequest requestWithURL:url];
NSURLSession *session = [NSURLSession sharedSession];
//执行绘画的任务 通过request请求获取数据data
NSURLSessionDataTask *dtatt = [session dataTaskWithRequest:urlr completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
NSArray *arrjson = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error];
NSLog(@"%@",arrjson);
}];
//真正执行任务
[dtatt resume];