14 #include <restinio/exception.hpp> 15 #include <restinio/http_headers.hpp> 16 #include <restinio/message_builders.hpp> 17 #include <restinio/impl/connection_base.hpp> 42 :
public std::enable_shared_from_this< request_t >
49 request_id_t request_id,
50 http_request_header_t header,
52 impl::connection_handle_t connection,
53 endpoint_t remote_endpoint )
76 template <
typename Output = restinio_controlled_output_t >
82 return response_builder_t< Output >{
84 std::move( m_connection ),
86 m_header.should_keep_alive() };
90 auto request_id()
const noexcept {
return m_request_id; }
104 throw exception_t{
"connection already moved" };
122 o <<
"{req_id: " << req.request_id() <<
", " 123 "conn_id: " << req.connection_id() <<
", " 124 "path: " << req.header().path() <<
", " 125 "query: " << req.header().query() <<
"}";
146 return req.m_connection;
request_t(request_id_t request_id, http_request_header_t header, std::string body, impl::connection_handle_t connection, endpoint_t remote_endpoint)
friend impl::connection_handle_t & impl::access_req_connection(request_t &) noexcept
const http_request_header_t m_header
std::ostream & operator<<(std::ostream &o, const request_t &req)
auto create_response(http_status_line_t status_line=status_ok())
const endpoint_t & remote_endpoint() const noexcept
Get the remote endpoint of the underlying connection.
const request_id_t m_request_id
const http_request_header_t & header() const noexcept
Get request header.
auto request_id() const noexcept
Get request id.
impl::connection_handle_t m_connection
connection_id_t connection_id() const noexcept
Get connection id.
const connection_id_t m_connection_id
const std::string & body() const noexcept
Get request body.
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, optional_t< Value_Type > >::type opt_value(const Parameter_Container ¶ms, string_view_t key)
Gets the value of a parameter specified by key wrapped in optional_t<Value_Type> if parameter exists ...
const endpoint_t m_remote_endpoint
Remote endpoint for underlying connection.