|
SNode.C
|
#include <Request.h>
Public Member Functions | |
| Request (SocketContext *socketContext, const std::string &host) | |
| Request (Request &)=delete | |
| Request & | operator= (Request &)=delete |
| Request & | operator= (Request &&) noexcept=delete |
| void | setMasterRequest (const std::shared_ptr< MasterRequest > &masterRequest) |
| std::shared_ptr< MasterRequest > | getMasterRequest () const |
| SocketContext * | getSocketContext () const |
| Request & | host (const std::string &hostFieldValue) |
| Request & | append (const std::string &field, const std::string &value) |
| Request & | set (const std::string &field, const std::string &value, bool overwrite=true) |
| Request & | set (const std::map< std::string, std::string > &headers, bool overwrite=true) |
| Request & | type (const std::string &type) |
| Request & | cookie (const std::string &name, const std::string &value) |
| Request & | cookie (const std::map< std::string, std::string > &cookies) |
| Request & | query (const std::string &key, const std::string &value) |
| Request & | setTrailer (const std::string &field, const std::string &value, bool overwrite=true) |
| std::string | header (const std::string &field) const |
| const CiStringMap< std::string > & | getQueries () const |
| const CiStringMap< std::string > & | getHeaders () const |
| const CiStringMap< std::string > & | getTrailer () const |
| const CiStringMap< std::string > & | getCookies () const |
Public Attributes | |
| std::string | hostFieldValue |
| std::string | method = "GET" |
| std::string | url = "/" |
| int | httpMajor = 1 |
| int | httpMinor = 1 |
| std::size_t | count {0} |
Protected Member Functions | |
| Request (Request &&request) noexcept | |
| void | upgrade (const std::shared_ptr< Response > &response, const std::function< void(const std::string &)> &status) |
Protected Attributes | |
| CiStringMap< std::string > | queries |
| CiStringMap< std::string > | headers |
| CiStringMap< std::string > | cookies |
| CiStringMap< std::string > | trailer |
| std::size_t | contentLength = 0 |
| std::weak_ptr< MasterRequest > | masterRequest |
| web::http::client::SocketContext * | socketContext |
| TransferEncoding | transferEncoding = TransferEncoding::HTTP10 |
| ConnectionState | connectionState = ConnectionState::Default |
Friends | |
| class | MasterRequest |
| web::http::client::Request::Request | ( | SocketContext * | socketContext, |
| const std::string & | host | ||
| ) |
Definition at line 77 of file Request.cpp.
References host(), hostFieldValue, set(), and socketContext.
Referenced by web::http::client::MasterRequest::MasterRequest().
|
explicitdelete |
|
explicitprotectednoexcept |
Definition at line 84 of file Request.cpp.
References connectionState, contentLength, cookies, count, headers, host(), hostFieldValue, httpMajor, httpMinor, masterRequest, method, queries, set(), socketContext, trailer, transferEncoding, and url.
Referenced by web::http::client::MasterRequest::MasterRequest().
| Request & web::http::client::Request::append | ( | const std::string & | field, |
| const std::string & | value | ||
| ) |
Definition at line 124 of file Request.cpp.
References headers, and set().
| Request & web::http::client::Request::cookie | ( | const std::map< std::string, std::string > & | cookies | ) |
Definition at line 202 of file Request.cpp.
References cookie().
| Request & web::http::client::Request::cookie | ( | const std::string & | name, |
| const std::string & | value | ||
| ) |
Definition at line 196 of file Request.cpp.
References cookies.
Referenced by cookie().
| const CiStringMap< std::string > & web::http::client::Request::getCookies | ( | ) | const |
Definition at line 253 of file Request.cpp.
References cookies.
Referenced by web::http::client::SocketContext::requestPrepared().
| const CiStringMap< std::string > & web::http::client::Request::getHeaders | ( | ) | const |
Definition at line 245 of file Request.cpp.
References headers.
Referenced by web::http::client::SocketContext::requestPrepared().
| std::shared_ptr< MasterRequest > web::http::client::Request::getMasterRequest | ( | ) | const |
Definition at line 110 of file Request.cpp.
References masterRequest.
| const CiStringMap< std::string > & web::http::client::Request::getQueries | ( | ) | const |
Definition at line 241 of file Request.cpp.
References queries.
Referenced by web::http::client::SocketContext::requestPrepared().
| SocketContext * web::http::client::Request::getSocketContext | ( | ) | const |
Definition at line 114 of file Request.cpp.
References socketContext.
Referenced by web::http::client::MasterRequest::executeUpgrade(), main(), web::http::client::MasterRequest::requestEventSource(), and web::http::client::MasterRequest::upgrade().
| const CiStringMap< std::string > & web::http::client::Request::getTrailer | ( | ) | const |
Definition at line 249 of file Request.cpp.
References trailer.
Referenced by web::http::client::SocketContext::requestPrepared().
| std::string web::http::client::Request::header | ( | const std::string & | field | ) | const |
Definition at line 235 of file Request.cpp.
References headers.
Referenced by web::websocket::client::SocketContextUpgradeFactory::create(), main(), web::http::client::MasterRequest::requestEventSource(), web::http::client::SocketContext::requestPrepared(), upgrade(), and web::http::client::MasterRequest::upgrade().
| Request & web::http::client::Request::host | ( | const std::string & | hostFieldValue | ) |
Definition at line 118 of file Request.cpp.
References set().
Referenced by Request(), and Request().
| Request & web::http::client::Request::query | ( | const std::string & | key, |
| const std::string & | value | ||
| ) |
Definition at line 210 of file Request.cpp.
References queries.
| Request & web::http::client::Request::set | ( | const std::map< std::string, std::string > & | headers, |
| bool | overwrite = true |
||
| ) |
Definition at line 182 of file Request.cpp.
References set().
| Request & web::http::client::Request::set | ( | const std::string & | field, |
| const std::string & | value, | ||
| bool | overwrite = true |
||
| ) |
Definition at line 136 of file Request.cpp.
References web::http::Chunked, web::http::ciContains(), web::http::ciEquals(), web::http::Close, connectionState, contentLength, headers, web::http::Identity, web::http::Keep, and transferEncoding.
Referenced by append(), web::http::client::MasterRequest::executeSendFile(), web::http::client::MasterRequest::executeSendHeader(), web::http::client::MasterRequest::executeUpgrade(), host(), main(), web::websocket::client::SocketContextUpgradeFactory::prepare(), Request(), Request(), web::http::client::MasterRequest::requestEventSource(), web::http::client::MasterRequest::send(), web::http::client::MasterRequest::send(), set(), and setTrailer().
| void web::http::client::Request::setMasterRequest | ( | const std::shared_ptr< MasterRequest > & | masterRequest | ) |
Definition at line 106 of file Request.cpp.
References masterRequest.
| Request & web::http::client::Request::setTrailer | ( | const std::string & | field, |
| const std::string & | value, | ||
| bool | overwrite = true |
||
| ) |
Definition at line 216 of file Request.cpp.
References headers, set(), and trailer.
| Request & web::http::client::Request::type | ( | const std::string & | type | ) |
Definition at line 190 of file Request.cpp.
References headers.
Referenced by main().
|
protected |
Definition at line 257 of file Request.cpp.
References web::http::ciContains(), core::socket::stream::SocketContext::close(), web::http::SocketContextUpgradeFactory< RequestT, ResponseT >::create(), web::http::client::Response::get(), core::socket::stream::SocketConnection::getConnectionName(), core::socket::stream::SocketContext::getSocketConnection(), header(), web::http::client::SocketContextUpgradeFactorySelector::instance(), masterRequest, web::http::SocketContextUpgradeFactory< RequestT, ResponseT >::name(), web::http::client::SocketContextUpgradeFactorySelector::select(), socketContext, and core::socket::stream::SocketContext::switchSocketContext().
Referenced by web::http::client::MasterRequest::upgrade().
|
friend |
|
protected |
Definition at line 142 of file Request.h.
Referenced by web::http::client::MasterRequest::init(), Request(), and set().
|
protected |
Definition at line 136 of file Request.h.
Referenced by web::http::client::MasterRequest::executeSendFile(), web::http::client::MasterRequest::executeSendFragment(), web::http::client::MasterRequest::executeSendHeader(), web::http::client::MasterRequest::init(), Request(), web::http::client::MasterRequest::requestDelivered(), web::http::client::MasterRequest::sendFragment(), and set().
|
protected |
Definition at line 133 of file Request.h.
Referenced by cookie(), web::http::client::MasterRequest::executeSendHeader(), web::http::client::MasterRequest::executeUpgrade(), getCookies(), web::http::client::MasterRequest::init(), and Request().
| std::size_t web::http::client::Request::count {0} |
Definition at line 126 of file Request.h.
Referenced by web::http::client::SocketContext::deliverResponse(), web::http::client::SocketContext::deliverResponseParseError(), web::http::client::SocketContext::initiateRequest(), Request(), web::http::client::SocketContext::requestCompleted(), web::http::client::SocketContext::requestDelivered(), and web::http::client::SocketContext::requestPrepared().
|
protected |
Definition at line 132 of file Request.h.
Referenced by append(), web::http::client::MasterRequest::executeSendHeader(), web::http::client::MasterRequest::executeUpgrade(), getHeaders(), header(), web::http::client::MasterRequest::init(), Request(), set(), setTrailer(), and type().
| std::string web::http::client::Request::hostFieldValue |
| int web::http::client::Request::httpMajor = 1 |
Definition at line 123 of file Request.h.
Referenced by web::http::client::SocketContext::deliverResponse(), web::http::client::SocketContext::deliverResponseParseError(), web::http::client::MasterRequest::executeSendFile(), web::http::client::MasterRequest::executeSendHeader(), web::http::client::MasterRequest::executeUpgrade(), web::http::client::MasterRequest::init(), web::http::client::SocketContext::initiateRequest(), Request(), web::http::client::SocketContext::requestCompleted(), web::http::client::SocketContext::requestDelivered(), web::http::client::MasterRequest::requestEventSource(), web::http::client::SocketContext::requestPrepared(), web::http::client::MasterRequest::upgrade(), and web::http::client::SocketContext::~SocketContext().
| int web::http::client::Request::httpMinor = 1 |
Definition at line 124 of file Request.h.
Referenced by web::http::client::SocketContext::deliverResponse(), web::http::client::SocketContext::deliverResponseParseError(), web::http::client::MasterRequest::executeSendFile(), web::http::client::MasterRequest::executeSendHeader(), web::http::client::MasterRequest::executeUpgrade(), web::http::client::MasterRequest::init(), web::http::client::SocketContext::initiateRequest(), Request(), web::http::client::SocketContext::requestCompleted(), web::http::client::SocketContext::requestDelivered(), web::http::client::MasterRequest::requestEventSource(), web::http::client::SocketContext::requestPrepared(), web::http::client::MasterRequest::upgrade(), and web::http::client::SocketContext::~SocketContext().
|
protected |
Definition at line 138 of file Request.h.
Referenced by web::http::client::MasterRequest::end(), getMasterRequest(), web::http::client::MasterRequest::onSourceConnect(), web::http::client::MasterRequest::onSourceEof(), web::http::client::MasterRequest::onSourceError(), Request(), web::http::client::MasterRequest::requestDelivered(), web::http::client::MasterRequest::requestEventSource(), web::http::client::MasterRequest::send(), web::http::client::MasterRequest::sendFile(), web::http::client::MasterRequest::sendFragment(), web::http::client::MasterRequest::sendHeader(), setMasterRequest(), upgrade(), web::http::client::MasterRequest::upgrade(), and web::http::client::MasterRequest::~MasterRequest().
| std::string web::http::client::Request::method = "GET" |
Definition at line 121 of file Request.h.
Referenced by web::http::client::SocketContext::deliverResponse(), web::http::client::SocketContext::deliverResponseParseError(), web::http::client::MasterRequest::executeSendHeader(), web::http::client::MasterRequest::executeUpgrade(), web::http::client::MasterRequest::init(), web::http::client::SocketContext::initiateRequest(), main(), Request(), web::http::client::SocketContext::requestCompleted(), web::http::client::SocketContext::requestDelivered(), web::http::client::SocketContext::requestPrepared(), web::http::client::MasterRequest::upgrade(), and web::http::client::SocketContext::~SocketContext().
|
protected |
Definition at line 131 of file Request.h.
Referenced by web::http::client::MasterRequest::executeSendHeader(), web::http::client::MasterRequest::executeUpgrade(), getQueries(), web::http::client::MasterRequest::init(), query(), and Request().
|
protected |
Definition at line 139 of file Request.h.
Referenced by web::http::client::MasterRequest::executeSendFragment(), web::http::client::MasterRequest::executeSendHeader(), web::http::client::MasterRequest::executeUpgrade(), getSocketContext(), web::http::client::MasterRequest::onSourceConnect(), web::http::client::MasterRequest::onSourceEof(), web::http::client::MasterRequest::onSourceError(), Request(), Request(), web::http::client::MasterRequest::requestDelivered(), web::http::client::MasterRequest::requestPrepared(), upgrade(), and web::http::client::MasterRequest::~MasterRequest().
|
protected |
Definition at line 134 of file Request.h.
Referenced by web::http::client::MasterRequest::executeUpgrade(), getTrailer(), web::http::client::MasterRequest::init(), Request(), web::http::client::MasterRequest::requestDelivered(), and setTrailer().
|
protected |
Definition at line 141 of file Request.h.
Referenced by web::http::client::MasterRequest::executeSendFragment(), web::http::client::MasterRequest::init(), Request(), web::http::client::MasterRequest::requestDelivered(), and set().
| std::string web::http::client::Request::url = "/" |
Definition at line 122 of file Request.h.
Referenced by web::http::client::SocketContext::deliverResponse(), web::http::client::SocketContext::deliverResponseParseError(), web::http::client::MasterRequest::executeSendHeader(), web::http::client::MasterRequest::executeUpgrade(), web::http::client::MasterRequest::init(), web::http::client::SocketContext::initiateRequest(), main(), Request(), web::http::client::SocketContext::requestCompleted(), web::http::client::SocketContext::requestDelivered(), web::http::client::MasterRequest::requestEventSource(), web::http::client::SocketContext::requestPrepared(), web::http::client::MasterRequest::upgrade(), and web::http::client::SocketContext::~SocketContext().