当前位置: 首页>>代码示例>>C++>>正文


C++ KQOAuthParameters::value方法代码示例

本文整理汇总了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_);
}
开发者ID:,项目名称:,代码行数:84,代码来源:


注:本文中的KQOAuthParameters::value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。