- * @param mixed $x The input content.
- * @param string $content_type Type of the input (Default: 'application/json').
- * @param integer $options JSON options
+ * @param mixed $content The input content
+ * @param string $content_type Type of the input (Default: 'application/json')
+ * @param integer $options JSON options
+ * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+ */
+ public static function jsonExit($content, $content_type = 'application/json', int $options = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) {
+ DI::apiResponse()->setType(Response::TYPE_JSON, $content_type);
+ DI::apiResponse()->addContent(json_encode($content, $options));
+ DI::page()->exit(DI::apiResponse()->generate());
+
+ self::exit();
+ }
+
+ /**
+ * Exit the program execution.