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