我正在使用gdata获取应用程序用户的gmail联系人照片,正是以下代码。 但有时提取有效,有时则无效,并给我以下错误: (我怀疑谷歌服务器有太多的令牌?虽然我还不太熟悉这个概念。但是我确实需要获取所有用户的联系人照片,有没有办法
解决这个问题??提前谢谢你,
imageFetcher:GTMHTTPFetcher 0x145ea3300 (https://www.google.com/m8/feeds/photos/media/XXXXX%40gmail.com/XXXXX) failedWithError:Error Domain=com.google.HTTPStatus Code=503 "无法完成操作。(com.google.HTTPStatus error 503.)"
if ([[[contact photoLink] ETag] length] ) {
// imageData = [NSData dataWithContentsOfURL:photoURL];
// requestForURL:ETag:httpMethod: sets the user agent header of the
// request and, when using ClientLogin, adds the authorization header
// get an NSURLRequest object with an auth token
self.flyingtoken ++;
NSURL *imageURL = [[contact photoLink] URL];
GDataServiceGoogleContact *service = [self contactService];
// requestForURL:ETag:httpMethod: sets the user agent header of the
// request and, when using ClientLogin, adds the authorization header
NSMutableURLRequest *request = [service requestForURL:imageURL
ETag:nil
httpMethod:nil];
[request setValue:@"image/*" forHTTPHeaderField:@"Accept"];
GTMHTTPFetcher *fetcher = [GTMHTTPFetcher fetcherWithRequest:request];
[fetcher setAuthorizer:[service authorizer]];
[fetcher beginFetchWithDelegate:self
didFinishSelector:@selector(imageFetcher:finishedWithData:error:)];
}
服务器通常会返回 503 错误,表明您的配额已超出。尝试实现指数回退 developers.google.com/api-client-library/java/...
以下是SGC的答案:谷歌服务器通常会返回503错误,表明您的配额已超出。尝试实现指数回退 developers.google.com/api-client-library/java/...