本文整理汇总了C++中http_request::get_pass方法的典型用法代码示例。如果您正苦于以下问题:C++ http_request::get_pass方法的具体用法?C++ http_request::get_pass怎么用?C++ http_request::get_pass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类http_request
的用法示例。
在下文中一共展示了http_request::get_pass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render_DELETE
void FoldersService::render_DELETE(const http_request& req, http_response** res)
{
if (req.get_user()=="a" && req.get_pass()=="a")
{
string strid = req.get_arg("id");
CUUID id = CUUID::Parse(strid);
HisDevFolder* folder = dynamic_cast<HisDevFolder*>(root->GetFolder()->Find(id));
if (folder!=NULL)
{
HisDevFolder* parentfolder = dynamic_cast<HisDevFolder*>(folder->GetParent());
parentfolder->Remove(id);
delete(folder);
root->Save();
*res = new http_string_response("", 200, "application/json");
return;
}
}
else
{
string message = "Autentication error";
*res = new http_string_response(message.c_str(), 401, "application/json");
return;
}
*res = new http_string_response("", 403, "application/json");
}
示例2: render_PUT
void FoldersService::render_PUT(const http_request& req, http_response** res)
{
if (req.get_user()=="a" && req.get_pass()=="a")
{
string strid = req.get_arg("id");
string content = req.get_content();
if (UpdateFolder(strid,content))
{
*res = new http_string_response("", 200, "application/json");
return;
}
}
else
{
string message = "Autentication error";
*res = new http_string_response(message.c_str(), 401, "application/json");
return;
}
*res = new http_string_response("", 403, "application/json");
}