CCF
Loading...
Searching...
No Matches
Functions
response

Functions

virtual void ccf::RpcContext::set_response_body (const std::vector< uint8_t > &body)=0
 Sets the main body or payload of the response.
 
virtual void ccf::RpcContext::set_response_body (std::vector< uint8_t > &&body)=0
 Sets the main body or payload of the response.
 
virtual void ccf::RpcContext::set_response_body (std::string &&body)=0
 Sets the main body or payload of the response.
 
virtual const std::vector< uint8_t > & ccf::RpcContext::get_response_body () const =0
 
virtual void ccf::RpcContext::set_response_status (int status)=0
 Sets initial status code summarising result of RPC.
 
virtual int ccf::RpcContext::get_response_status () const =0
 
virtual void ccf::RpcContext::set_response_header (const std::string_view &name, const std::string_view &value)=0
 
virtual void ccf::RpcContext::set_response_header (const std::string_view &name, size_t n)
 
virtual void ccf::RpcContext::set_response_header (const http::HeaderKeyValue &kv)
 
virtual void ccf::RpcContext::clear_response_headers ()=0
 
virtual void ccf::RpcContext::set_response_trailer (const std::string_view &name, const std::string_view &value)=0
 
virtual void ccf::RpcContext::set_response_trailer (const std::string_view &name, size_t n)
 
virtual void ccf::RpcContext::set_response_trailer (const http::HeaderKeyValue &kv)
 
virtual void ccf::RpcContext::set_response_json (const nlohmann::json &body, http_status status)=0
 
virtual void ccf::RpcContext::set_error (http_status status, const std::string &code, std::string &&msg, const std::vector< nlohmann::json > &details={})=0
 Construct error response, formatted as JSON OData.
 
virtual void ccf::RpcContext::set_error (ccf::ErrorDetails &&error)=0
 Construct error response, formatted as JSON OData.
 

Detailed Description

Methods to set sections of response, which will be serialised and transmitted to client.

Function Documentation

◆ clear_response_headers()

virtual void ccf::RpcContext::clear_response_headers ( )
pure virtual

Implemented in http::HttpRpcContext.

◆ get_response_body()

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

Implemented in http::HttpRpcContext.

◆ get_response_status()

virtual int ccf::RpcContext::get_response_status ( ) const
pure virtual

Implemented in http::HttpRpcContext.

◆ set_error() [1/2]

virtual void ccf::RpcContext::set_error ( ccf::ErrorDetails &&  error)
pure virtual

Construct error response, formatted as JSON OData.

Implemented in ccf::RpcContextImpl.

◆ set_error() [2/2]

virtual void ccf::RpcContext::set_error ( http_status  status,
const std::string &  code,
std::string &&  msg,
const std::vector< nlohmann::json > &  details = {} 
)
pure virtual

Construct error response, formatted as JSON OData.

Implemented in ccf::RpcContextImpl.

◆ set_response_body() [1/3]

virtual void ccf::RpcContext::set_response_body ( const std::vector< uint8_t > &  body)
pure virtual

Sets the main body or payload of the response.

Implemented in http::HttpRpcContext.

◆ set_response_body() [2/3]

virtual void ccf::RpcContext::set_response_body ( std::string &&  body)
pure virtual

Sets the main body or payload of the response.

Implemented in http::HttpRpcContext.

◆ set_response_body() [3/3]

virtual void ccf::RpcContext::set_response_body ( std::vector< uint8_t > &&  body)
pure virtual

Sets the main body or payload of the response.

Implemented in http::HttpRpcContext.

◆ set_response_header() [1/3]

virtual void ccf::RpcContext::set_response_header ( const http::HeaderKeyValue kv)
inlinevirtual

◆ set_response_header() [2/3]

virtual void ccf::RpcContext::set_response_header ( const std::string_view &  name,
const std::string_view &  value 
)
pure virtual

Implemented in http::HttpRpcContext.

◆ set_response_header() [3/3]

virtual void ccf::RpcContext::set_response_header ( const std::string_view &  name,
size_t  n 
)
inlinevirtual

◆ set_response_json()

virtual void ccf::RpcContext::set_response_json ( const nlohmann::json &  body,
http_status  status 
)
pure virtual

Implemented in ccf::RpcContextImpl.

◆ set_response_status()

virtual void ccf::RpcContext::set_response_status ( int  status)
pure virtual

Sets initial status code summarising result of RPC.

Implemented in http::HttpRpcContext.

◆ set_response_trailer() [1/3]

virtual void ccf::RpcContext::set_response_trailer ( const http::HeaderKeyValue kv)
inlinevirtual

◆ set_response_trailer() [2/3]

virtual void ccf::RpcContext::set_response_trailer ( const std::string_view &  name,
const std::string_view &  value 
)
pure virtual

Implemented in http::HttpRpcContext.

◆ set_response_trailer() [3/3]

virtual void ccf::RpcContext::set_response_trailer ( const std::string_view &  name,
size_t  n 
)
inlinevirtual