getBody()->rewind(); $this->getBody()->write($csvData); $this->withStatus(200); return $this->withHeader('X-Total-Count', $maxRows)->withHeader('Content-Type', $mimeType); } /** * Response with an error message * * @param string $msg The message translation key * @param array $params Optional parameters to pass to the translation * * @return APIResponse */ public function withJsonError($msg, $params = null) { return $this->withJson( [ 'error' => $msg, 'errorMessage' => __($msg, $params ?? []), ] ); } } if (!PKP_STRICT_MODE) { class_alias('\PKP\core\APIResponse', '\APIResponse'); }