2011-04-01 48 views
0

我正在創建一個Iphone應用程序,並且正在嘗試發送獲取請求以訪問谷歌閱讀器的未讀郵件。到目前爲止,我已通過api捕獲了SID,Auth和Token,但是我不知道如何執行下一步獲取未讀列表的Feed。我是api的新手,我一直在嘗試各種各樣的在線搜索請求的組合。有人可以通過向我展示一些用於從谷歌閱讀器獲取未讀消息的代碼來獲得幫助。下面是一個例子,我曾嘗試請求來自Google閱讀器目標的未讀郵件c

NSURLResponse *response = nil; 
NSError *error = nil; 
url = [NSURL URLWithString:@"http://www.google.com/reader/api/0/stream/contents/user/-/state/com.google/reading-list"]; 
httpReq = [[[NSMutableURLRequest alloc] initWithURL:url]autorelease]; 
[httpReq setValue:[NSString stringWithFormat:@"T=%@", token] forHTTPHeaderField:@"Token:"]; 
[httpReq setHTTPMethod:@"GET"]; 

NSData *recieveData; 
recieveData = [NSURLConnection sendSynchronousRequest:httpReq returningResponse:&response error:&error]; 
NSString *responseStr = [[NSString alloc]initWithData:recieveData encoding:NSASCIIStringEncoding]; 
NSLog(@"message %@", responseStr); 

回答