googleclientのコードを書き込もうとしています-objective-cにログインします。「https://www.google.com/accounts/ClientLogin」からメールアドレスとパスワードで認証を取得し、POSTER(firefox)で正常にログインできます。
Objective-cのコードを書くと、ログインできず、エラーコード401が表示されます。
誰かが私が間違っていることを助けてくれますか?これが私のコードです。
// URL to check user info
NSURL *url = [NSURL URLWithString:@"http://www.google.com/reader/api/0/user-info"];
// authorization
NSString *auth = authString;
// create request
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
// add auth information in header
auth = [NSString stringWithFormat:@"GoogleLogin auth=%@", auth];
[request addValue:auth forHTTPHeaderField:@"Authorization"];
// send request
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
if (connection) {
NSLog(@"request send.");
} else {
NSLog(@"Connection Failed when getting feeds.");
}