NSURL *url = [NSURL URLWithString:URL];

NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevaildatingCacheData timeoutInterval:10];

NSURLResponse *response;

NSError *error;

NSData *data = [NSURLConnection sendSynchronousRequest returningResponse:&response error:&errro];

 

NSString *str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

 

NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&error];

NSLog(@"%@\n %@",str,dic);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
猜你喜欢
  • 2021-09-16
  • 2022-12-23
  • 2021-04-05
  • 2022-12-23
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
相关资源
相似解决方案