@
wy315700 同样的接口 自己写了一个简单的代码测试后,能够正常解析出数据
//用这个方法请求接口能够正常返回数据
-(NSData *)returnDownLoadWithJsonRequestStr:(NSString *)json Url:(NSString *)url
{
//第一步,创建URL
NSURL *url1 = [NSURL URLWithString:[NSString stringWithFormat:@"%@",url]];
//第二步,创建请求
NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL:url1 cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10];
[request setHTTPMethod:@"POST"];//设置请求方式为POST,默认为GET
//NSString *str = [NSString stringWithFormat:@"%@",json];//设置参数
NSData *data = [json dataUsingEncoding:NSUTF8StringEncoding];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:data];
//第三步,连接服务器
NSData *received = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
// NSLog(@"aaaaaa = %@",received);
return received;
}