我可以看到30个用户ID的历史通过这个网址获取JSON数据按照用户ID
http://userhistory.in/UserImage.svc/GetUnAnsweredImagesLog?UserId=30
,但在这里,用户标识是可变的基础上,用户注册生成。我只是尝试下面的代码来获取历史。而不是30位用户返回所有用户的历史记录。
NSString *[email protected]"30";
int i=[userID2 intValue];
NSString *urlString=[NSString stringWithFormat:@"http://37.187.152.236/UserImage.svc/GetUnAnsweredImagesLog?%d",i];
NSLog(@"url : %@",urlString);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]
cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
timeoutInterval:10];
[request setHTTPMethod: @"POST"];
这里是静态地传递用户ID。如果代码工作正常,那么我会从注册response.apart中获取它,我需要获取特定的userid历史记录。
我想,有什么不对您的服务器数据库,API开发人员不过滤用户历史记录结果。 'SELECT * FROM USER_HISTORY;'而不是''SELECT * FROM USER_HISTORY WHERE USER_ID = 30;'应用程序代码没有问题。 – Hemang