Zend\Json\Server\Response

The JSON-RPC response payload is encapsulated in the Zend\Json\Server\Response object. This object allows you to set the return value of the request, whether or not the response is an error, the request identifier, the JSON-RPC specification version the response conforms to, and optionally the service map.

The response object has the following methods available:

An HTTP specific version is available via Zend\Json\Server\Response\Http. This class will send the appropriate HTTP headers as well as serialize the response as JSON.