NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
// 设置URL
[request setURL:[NSURL URLWithString:@"http://www.baidu.com"]]; //请求服务器的API地址
// 设置HTTP方法
[request setHTTPMethod:@"GET"];
NSData *returnData = [NSURLConnection sendSynchronousRequest:request
returningResponse:nil error:nil];
NSLog(@"%@",returnData);
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:returnData options:0 error:nil];
NSLog(@"%@",dict);