+ /**
+ * Send an HTTP Response base on PSR HTTP RespnseInterface response.
+ *
+ * @param \Psr\Http\Message\ResponseInterface $response
+ */
+ public function sendResponse(\Psr\Http\Message\ResponseInterface $response) {
+ http_response_code($response->getStatusCode());
+ foreach ($response->getHeaders() as $name => $values) {
+ CRM_Utils_System::setHttpHeader($name, implode(', ', (array) $values));
+ }
+ echo $response->getBody();
+ CRM_Utils_System::civiExit();
+ }
+