适用于iPhone的HTTPS请求API

适用于iPhone的HTTPS请求API,https,request,Https,Request,我有一个API,看起来像 #https://www.wikifood.eu/wikifood/en/struts/userfoodDB.do?method=getProductOverview&query=4016249502058&startAt=0&limit=5&filter=true&loginname=developer&password=4f14f46f76c4b9be2150be579669e699b79f0093 我需要将它添加到我的应用程序,扫描条形码。所以参数查询我需要更改

我有一个API,看起来像 #https://www.wikifood.eu/wikifood/en/struts/userfoodDB.do?method=getProductOverview&query=4016249502058&startAt=0&limit=5&filter=true&loginname=developer&password=4f14f46f76c4b9be2150be579669e699b79f0093

我需要将它添加到我的应用程序,扫描条形码。所以参数查询我需要更改为resultText:

#https://www.wikifood.eu/wikifood/en/struts/userfoodDB.do?method=getProductOverview&query="resultText"&startAt=0&limit=5&filter=true&loginname=developer&password=4f14f46f76c4b9be2150be579669e699b79f0093 
现在我需要创建对数据库的请求。然后接收一些xml文件

1) 我怎么做?如果我只需要解析结果(xml文件)并在iPhone上显示它

2) 解析后结果能否显示在ImageView中

我现在正试图通过AsiTpRequest实现这一点,但实际上我不知道我应该做什么,除了以下几点:

- (IBAction)grabURLInBackground:(id)sender
{
 NSURL *url = [NSURL     URLWithString:@"https://www.wikifood.eu/wikifood/en/struts/userfoodDB.do?method=getProductOverview&query="resultText"&startAt=0&limit=5&filter=true&loginname=NNNNNNNN&password=PPPPPPPPPP"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDelegate:self];
[request startAsynchronous];
}

我应该在代理文件或控制器文件中添加其他内容吗

谢谢


希望很快收到你的来信,所以我也在使用AsitpRequest

当我从…requestFinished获取数据时,只需通过调用JSON值将其放入NSDictionary(下载api)

例如:

NSDictionary *dic = [[request responseString] JSONValue];
然后,您可以访问cellForRowAtIndexPath中的数据,在tableView中存储数据


明白了吗?

您是如何访问“ASIHTTPRequest”功能的?我想是的。我会尝试使用它。谢谢
NSDictionary *dic = [[request responseString] JSONValue];