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


C++ AuthRequest类代码示例

本文整理汇总了C++中AuthRequest的典型用法代码示例。如果您正苦于以下问题:C++ AuthRequest类的具体用法?C++ AuthRequest怎么用?C++ AuthRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AuthRequest类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AuthRequest

vector<Category*>* Session::GetCategories(string configId) {
    AuthRequest* authRequest = new AuthRequest(consumerKey, consumerSecret, configId, applicationName);
    QueryMethod method = GET;
    string url = host + "/categories." + format;
    cout << endl << "url: " << url << endl;
    int status = authRequest->authWebRequest(url, method);

    vector<Category*>* result = new vector<Category*>();
    if (status <= 202 && "" != authRequest->GetReceivedData()) {
        Stub_Categories* stub = new Stub_Categories();
        if (format == "xml") {
            (static_cast<XmlSerializer*>(serializer))->Deserialize(authRequest->GetReceivedData(), stub);
        } else {
            (static_cast<JsonSerializer*>(serializer))->Deserialize(authRequest->GetReceivedData(), stub);
        }
        result = stub->GetCategories();
        delete stub;
    }
    HandleRequest(method, url, "");
    HandleConfigurationResponse(status, authRequest);

    delete authRequest;

    return result;
}
开发者ID:Evtimm,项目名称:semantria-sdk,代码行数:25,代码来源:Session.cpp

示例2: AuthRequest

void JabberClient::auth_plain()
{
    AuthRequest *req = new AuthRequest(this);
    req->start_element("query");
    req->add_attribute("xmlns", "jabber:iq:auth");
    QString username = data.owner.getId();
    username = getToken(username, '@');
    req->text_tag("username", username);
    req->text_tag("password", getPassword());
    req->text_tag("resource", data.owner.getResource());
    req->send();
    m_requests.push_back(req);
}
开发者ID:BackupTheBerlios,项目名称:sim-im,代码行数:13,代码来源:jabber_auth.cpp


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