Methods to access fields of the received request. Describes fields parsed from HTTP, but aims to generalise across other request protocols.
◆ frame_format()
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 |
◆ get_request_body()
virtual const std::vector< uint8_t > & ccf::RpcContext::get_request_body |
( |
| ) |
const |
|
pure virtual |
◆ 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 |
◆ get_request_path()
virtual std::string ccf::RpcContext::get_request_path |
( |
| ) |
const |
|
pure virtual |
◆ 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 |
◆ 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 |
◆ get_responder()
◆ 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 |
◆ set_user_data()
virtual void ccf::RpcContext::set_user_data |
( |
std::shared_ptr< void > |
data | ) |
|
|
pure virtual |