ios - Twitter API 返回错误 : SSL is required(92)
<p><p>我想获取用户的推文。<br/>
以下代码是使用 twitter API 并获取用户的推文。<br/>
但是日志输出 <code>data:{"errors":[{"message":"SSL is required","code":92}]}</code></p>
<pre><code>- (void)getJSON
{
NSURL* url = ;
OAConsumer* consumer = [initWithKey:kTwitterAPIKey secret:kTwitterAPISecret];
OAMutableURLRequest* request = [initWithURL:url consumer:consumer token:_responseToken realm:nil signatureProvider:nil];
;
OADataFetcher* fetcher = [init];
;
}
- (void)getData:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data
{
NSString* responseBody = [initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"data:%@", responseBody);
}
</code></pre>
<p>我需要使用 SSL 吗?如何使用 SSL?<br/>
你有什么想法吗?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>在您的网址中使用“https”:</p>
<pre><code>https://api.twitter.com/1.1/statuses/user_timeline.json
</code></pre>
<p>这一定足以解决问题。</p></p>
<p style="font-size: 20px;">关于ios - Twitter API 返回错误 : SSL is required(92),我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/26030587/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/26030587/
</a>
</p>
页:
[1]