CCF
Loading...
Searching...
No Matches
Functions
request

Functions

virtual std::shared_ptr< SessionContextccf::RpcContext::get_session_context () const =0
 
virtual void ccf::RpcContext::set_user_data (std::shared_ptr< void > data)=0
 
virtual void * ccf::RpcContext::get_user_data () const =0
 
virtual const std::vector< uint8_t > & ccf::RpcContext::get_request_body () const =0
 
virtual const std::string & ccf::RpcContext::get_request_query () const =0
 
virtual const ccf::RESTVerbccf::RpcContext::get_request_verb () const =0
 
virtual std::string ccf::RpcContext::get_request_path () const =0
 
virtual std::string ccf::RpcContext::get_method () const =0
 
virtual std::shared_ptr< ccf::http::HTTPResponderccf::RpcContext::get_responder () const =0
 
virtual const PathParamsccf::RpcContext::get_request_path_params ()=0
 
virtual const PathParamsccf::RpcContext::get_decoded_request_path_params ()=0
 
virtual const http::HeaderMapccf::RpcContext::get_request_headers () const =0
 Returns map of all headers found in the request.
 
virtual std::optional< std::string > ccf::RpcContext::get_request_header (const std::string_view &name) const =0
 
virtual const std::string & ccf::RpcContext::get_request_url () const =0
 
virtual ccf::FrameFormat ccf::RpcContext::frame_format () const =0
 

Detailed Description

Methods to access fields of the received request. Describes fields parsed from HTTP, but aims to generalise across other request protocols.

Function Documentation

◆ frame_format()

virtual ccf::FrameFormat ccf::RpcContext::frame_format ( ) const
pure virtual

Returns frame format describing the protocol that the request was received over.

Implemented in http::HttpRpcContext.

◆ get_decoded_request_path_params()

virtual const PathParams & ccf::RpcContext::get_decoded_request_path_params ( )
pure virtual

Decodes the path before returning a map of all PathParams. For example, if the endpoint was installed at /foo/{name}/{age}, and for the request path /foo/bob%3A/42, this would return the map: {"name": "bob:", "age": "42"}

Implemented in ccf::RpcContextImpl.

◆ get_method()

virtual std::string ccf::RpcContext::get_method ( ) const
pure virtual

Implemented in http::HttpRpcContext.

◆ get_request_body()

virtual const std::vector< uint8_t > & ccf::RpcContext::get_request_body ( ) const
pure virtual

Implemented in http::HttpRpcContext.

◆ get_request_header()

virtual std::optional< std::string > ccf::RpcContext::get_request_header ( const std::string_view &  name) const
pure virtual

Returns value associated with named header, or nullopt of this header was not present.

Implemented in http::HttpRpcContext.

◆ get_request_headers()

virtual const http::HeaderMap & ccf::RpcContext::get_request_headers ( ) const
pure virtual

Returns map of all headers found in the request.

Implemented in http::HttpRpcContext.

◆ get_request_path()

virtual std::string ccf::RpcContext::get_request_path ( ) const
pure virtual

Implemented in http::HttpRpcContext.

◆ get_request_path_params()

virtual const PathParams & ccf::RpcContext::get_request_path_params ( )
pure virtual

Returns a map of all PathParams parsed out of the original query path. For instance if this endpoint was installed at /foo/{name}/{age}, and the request path /foo/bob/42, this would return the map: {"name": "bob", "age": "42"}

Implemented in ccf::RpcContextImpl.

◆ get_request_query()

virtual const std::string & ccf::RpcContext::get_request_query ( ) const
pure virtual

Implemented in http::HttpRpcContext.

◆ get_request_url()

virtual const std::string & ccf::RpcContext::get_request_url ( ) const
pure virtual

Returns full URL provided in request, rather than split into path + query.

Implemented in http::HttpRpcContext.

◆ get_request_verb()

virtual const ccf::RESTVerb & ccf::RpcContext::get_request_verb ( ) const
pure virtual

Implemented in http::HttpRpcContext.

◆ get_responder()

virtual std::shared_ptr< ccf::http::HTTPResponder > ccf::RpcContext::get_responder ( ) const
pure virtual

Implemented in http::HttpRpcContext.

◆ get_session_context()

virtual std::shared_ptr< SessionContext > ccf::RpcContext::get_session_context ( ) const
pure virtual

Return information about the persistent session which this request was received on. Allows correlation between multiple requests coming from the same long-lived session.

Implemented in ccf::RpcContextImpl.

◆ get_user_data()

virtual void * ccf::RpcContext::get_user_data ( ) const
pure virtual

Implemented in ccf::RpcContextImpl.

◆ set_user_data()

virtual void ccf::RpcContext::set_user_data ( std::shared_ptr< void >  data)
pure virtual

Implemented in ccf::RpcContextImpl.