Boost C++ Libraries

PrevUpHomeNext

Function make_response

boost::taar::jsonrpc::make_response — Build a successful JSON-RPC 2.0 response envelope.

Synopsis

// In header: <boost/taar/jsonrpc/response.hpp>


boost::json::value 
make_response(boost::json::value id, boost::json::value result);

Description

Produces the spec's response shape:

{ "jsonrpc": "2.0", "id": <id>, "result": <result> }

Parameters:

id

The id from the originating request. null is acceptable and is emitted verbatim. Notifications do not get a response – callers should not invoke this builder for notification envelopes.

result

The method's return value, already in JSON form.


PrevUpHomeNext