Response::json()
Creates a json response with appropriate header and automatic conversion of arrays.
Response::json(array|string $body = '', int|null $code = null, bool|null $pretty = null, array $headers = [ ]): Kirby\Cms\Response
Parameters
| Name | Type | Default |
|---|---|---|
| $body | arrayorstring |
''
|
| $code | intornull |
null
|
| $pretty | boolornull |
null
|
| $headers | array |
[ ]
|
Return type
Parent class
Kirby\Cms\Response
inherited from Kirby\Http\Response