2
이 twitter API 요청에 대해 항상 401 Unauthorized
응답을받습니다. 트위터 세션이있어서 요청에 서명하기 때문에 혼란 스럽습니다. 미리 감사드립니다.401 트위터 API를 사용하는 승인되지 않은 오류
NSURL *retweetAPIURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.twitter.com/1.1/statuses/retweet/%@.json", tweetID]];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:retweetAPIURL];
request.HTTPMethod = @"POST";
if (self.twitterSession) {
[self.twitterSession signRequest:request];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
operation.responseSerializer = [AFJSONResponseSerializer serializer];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
block(nil, responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
block(error, nil);
}];
[[NSOperationQueue mainQueue] addOperation:operation];
} else {
block([self createErrorWithMessage:NSLocalizedString(NSLocalizedString(@"TWITTER LOGIN ERROR", nil), nil)], nil);
}
다음으로이 솔루션을 사용해 보겠습니다.하지만 문제는 내가 Parse.com을 백엔드에 사용하고 Twitter를 앱에 (설정에 로그인하지 않음) 사용하는 것입니다. 요청을 확인하는 방법을 알려주시겠습니까? –