本文整理汇总了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;
}
示例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);
}