mirror of
https://github.com/friendica/friendica
synced 2025-04-21 22:30:11 +00:00
Add response for JSON only
This commit is contained in:
parent
d925e25424
commit
fb1e8e75f5
3 changed files with 13 additions and 3 deletions
|
@ -221,6 +221,16 @@ class ApiResponse extends Response
|
|||
$this->addContent($return);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper around exit() for JSON only responses
|
||||
*
|
||||
* @param array $data
|
||||
*/
|
||||
public function exitWithJson(array $data)
|
||||
{
|
||||
$this->exit('content', ['content' => $data], static::TYPE_JSON);
|
||||
}
|
||||
|
||||
/**
|
||||
* Quit execution with the message that the endpoint isn't implemented
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue