本文整理汇总了C++中KQOAuthParameters::value方法的典型用法代码示例。如果您正苦于以下问题:C++ KQOAuthParameters::value方法的具体用法?C++ KQOAuthParameters::value怎么用?C++ KQOAuthParameters::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KQOAuthParameters
的用法示例。
在下文中一共展示了KQOAuthParameters::value方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SignedRequest
void TwitterInterface::SignedRequest (TwitterRequest req,
KQOAuthRequest::RequestHttpMethod method, KQOAuthParameters params)
{
QUrl reqUrl;
if (Token_.isEmpty () || TokenSecret_.isEmpty ())
{
qWarning () << "No access tokens. Aborting.";
return;
}
switch (req)
{
case TwitterRequest::HomeTimeline:
reqUrl = "https://api.twitter.com/1.1/statuses/home_timeline.json";
params.insert ("count", "50");
params.insert ("include_entities", "true");
break;
case TwitterRequest::UserTimeline:
reqUrl = "http://api.twitter.com/1.1/statuses/user_timeline.json";
params.insert ("include_entities", "true");
break;
case TwitterRequest::Search:
reqUrl = "https://api.twitter.com/1.1/search/tweets.json";
params.insert ("count", "50");
params.insert ("include_entities", "true");
break;
case TwitterRequest::Update:
reqUrl = "http://api.twitter.com/1.1/statuses/update.json";
break;
case TwitterRequest::Direct:
reqUrl = "https://api.twitter.com/1.1/direct_messages.json";
case TwitterRequest::Retweet:
reqUrl = QString ("http://api.twitter.com/1.1/statuses/retweet/")
.append (params.value ("id"))
.append (".json");
break;
case TwitterRequest::Reply:
reqUrl = "http://api.twitter.com/1.1/statuses/update.json";
break;
case TwitterRequest::SpamReport:
reqUrl = "http://api.twitter.com/1.1/report_spam.json";
break;
case TwitterRequest::Delete:
reqUrl = QString ("http://api.twitter.com/1.1/statuses/destroy/")
.append (params.value ("id"))
.append (".json");
break;
case TwitterRequest::CreateFavorite:
reqUrl = QString ("https://api.twitter.com/1.1/favorites/create.json");
break;
case TwitterRequest::DeleteFavorite:
reqUrl = QString ("https://api.twitter.com/1.1/favorites/destroy.json");
break;
case TwitterRequest::ListFavorites:
reqUrl = "https://api.twitter.com/1.1/favorites/list.json";
params.insert ("include_entities", "true");
params.insert ("count", "50");
break;
default:
return;
}
OAuthRequest_->initRequest (KQOAuthRequest::AuthorizedRequest, reqUrl);
OAuthRequest_->setHttpMethod (method);
OAuthRequest_->setConsumerKey (ConsumerKey_);
OAuthRequest_->setConsumerSecretKey (ConsumerKeySecret_);
OAuthRequest_->setToken (Token_);
OAuthRequest_->setTokenSecret (TokenSecret_);
OAuthRequest_->setAdditionalParameters (params);
OAuthManager_->executeRequest (OAuthRequest_);
}