Note that there are some explanatory texts on larger screens.

plurals
  1. POError in accessing google reader's Endpoints API
    text
    copied!<p>I am trying to implement google reader in iPhone APP and so far I have successfully received the <strong>sid</strong> and <strong>auth</strong>. The problem arises when I try to call the Endpoints API with <strong>GET</strong>.. Here's the code:</p> <pre><code> ASIHTTPRequest *request = [self requestForAPIEndpoint:@"https://www.google.com/reader/api/0/subscription/list?output=json"]; [request setDelegate:self]; [request startAsynchronous]; - (ASIHTTPRequest *) requestForAPIEndpoint: (NSString *) apiEndpoint { ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString: apiEndpoint]]; [request addRequestHeader: @"User-Agent" value: @"YourClient"]; [request addRequestHeader: @"Cookie" value: signature]; NSLog(@"Sig = %@",signature); [request addRequestHeader: @"Authorization" value: autho]; return request. } </code></pre> <p>The autho and signature are correctly set. However every-time I get callback in - <strong>(void)requestFailed:(ASIHTTPRequest *)request</strong> method. What is that I am doing wrong?? Do I need to register some where to access the API and set the user-agent to that name??</p> <p>I modified the <strong>requestForAPIEndpoint</strong> method as follows then also I have the same problem.</p> <pre><code>- (ASIHTTPRequest *) requestForAPIEndpoint: (NSString *) apiEndpoint { NSDictionary *properties = [[[NSMutableDictionary alloc] init] autorelease]; [properties setValue:signature forKey:NSHTTPCookieValue]; [properties setValue:@"SID" forKey:NSHTTPCookieName]; [properties setValue:@".google.com" forKey:NSHTTPCookieDomain]; [properties setValue:@"1600000000" forKey:NSHTTPCookieExpires]; [properties setValue:@"/" forKey:NSHTTPCookiePath]; NSHTTPCookie *cookie = [[[NSHTTPCookie alloc] initWithProperties:properties] autorelease]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString: apiEndpoint]]; [request setUseCookiePersistence:NO]; [request setRequestCookies:[NSMutableArray arrayWithObject:cookie]]; [request addRequestHeader: @"User-Agent" value: @"YourClient"]; [request addRequestHeader: @"Authorization" value: autho]; return request; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload