1

こんにちは、アプリにReadability APIを実装しようとして いますが、ステータス コード 500 - 「不明な問題」しか表示されません。私の応答本文は、「ページが利用できません」という html ページです。

私はRestKitを使用しています。

これが私が接続しようとする方法です:

-(void)sendRequests
{
    NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
                            @"myconsumerkey", @"oauth_consumer_key",
                            [NSString stringWithFormat:@"%f", [[NSDate date] timeIntervalSince1970]], @"oauth_timestamp",
                            [self uuid], @"oauth_nonce",
                            @"HMAC-SHA1", @"oauth_signature_method",
                            @"mysecretkey", @"oauth_consumer_secret",
                            @"1.0",@"oauth_version",
                            @"username", @"x_auth_username",
                            @"password", @"x_auth_password",
                            @"client_auth", @"x_auth_mode", nil];
    RKClient *client = [RKClient clientWithBaseURL:[NSURL URLWithString:@"https://www.readability.com/api/rest/v1"]];

    [client post:@"/oauth/access_token" params:params delegate:self];
}

本当にありがとうございました!

4

1 に答える 1

1

物事を簡素化するために、RestKit で GCOAuth パッケージの 1 つを使用する必要があります。GCOAuth で xauth を実行するための例を次に示します。

NSURLRequest *xauth = [GCOAuth URLRequestForPath:@"/oauth/access_token"
POSTParameters:[NSDictionary dictionaryWithObjectsAndKeys:
username, @"x_auth_username",
password, @"x_auth_password",
@"client_auth", @"x_auth_mode",
nil]
host:@"api.twitter.com"
consumerKey:CONSUMER_KEY
consumerSecret:CONSUMER_SECRET
accessToken:nil
tokenSecret:nil];
于 2012-08-16T15:20:31.283 に答える