本文整理汇总了C++中http::Request::has方法的典型用法代码示例。如果您正苦于以下问题:C++ Request::has方法的具体用法?C++ Request::has怎么用?C++ Request::has使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类http::Request
的用法示例。
在下文中一共展示了Request::has方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createHandshakeRequest
void WebSocketFramer::createHandshakeRequest(http::Request& request)
{
assert(_mode == ws::ClientSide);
assert(_headerState == 0);
// Send the handshake request
_key = createKey();
request.setChunkedTransferEncoding(false);
request.set("Connection", "Upgrade");
request.set("Upgrade", "websocket");
request.set("Sec-WebSocket-Version", ws::ProtocolVersion);
assert(request.has("Sec-WebSocket-Version"));
request.set("Sec-WebSocket-Key", _key);
assert(request.has("Sec-WebSocket-Key"));
//TraceLS(this) << "Sec-WebSocket-Version: " << request.get("Sec-WebSocket-Version") << endl;
//TraceLS(this) << "Sec-WebSocket-Key: " << request.get("Sec-WebSocket-Key") << endl;
_headerState++;
}
示例2: updateAuthInfo
void Authenticator::updateAuthInfo(http::Request& request)
{
if (request.has("Authorization")) {
const std::string& authorization = request.get("Authorization");
if (isBasicCredentials(authorization)) {
BasicAuthenticator(_username, _password).authenticate(request);
}
// else if (isDigestCredentials(authorization))
// ; // TODO
}
}
示例3: hasProxyDigestCredentials
bool hasProxyDigestCredentials(const http::Request& request)
{
return request.has("Proxy-Authorization") &&
isDigestCredentials(request.get("Proxy-Authorization"));
}
示例4: hasBasicCredentials
bool hasBasicCredentials(const http::Request& request)
{
return request.has("Authorization") &&
isBasicCredentials(request.get("Authorization"));
}