1
您好,我正在嘗試在我的應用中實現Readability API ,但我得到的只是狀態碼500 - 「未知問題」。 我的響應正文是一個說明「頁面不可用」的html頁面。可讀性API和RestKit - 響應狀態代碼500
我正在使用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];
}
謝謝你很多!
感謝您的答覆。它確實有效 - 它顯示狀態碼200(OK)。但是我無法提取access_token。你能告訴我怎麼做嗎?再次感謝你。 – DevFly 2012-08-16 15:58:16
一旦你有NSURLRequest,你通過NSURLConnection發送它並接收數據。這是一個很好的例子[這個以前的答案](http://stackoverflow.com/questions/4456966/how-to-send-json-data-in-the-http-request-using-nsurlrequest)。你最終得到一個字典,你從 – 2012-08-16 16:22:12
請求accessToken和tokenSecret謝謝!你保存我的應用程序! – DevFly 2012-08-16 16:24:12