我是IOS的新手。我正在尝试调用 Facebook Graph URL 以获取 JSON 数据并对其进行解析-
NSString *urlStr = @"https://graph.facebook.com/102555409843504_373792589386450";
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlStr]
cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
timeoutInterval:10];
[request setHTTPMethod: @"GET"];
NSError *requestError;
NSURLResponse *urlResponse = nil;
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&requestError];
但它的返回错误-
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
-我有一个有效的会话,但不知道如何用它调用图形 API。