Skip to content

Kirby 3.7.5

Response::json()

Creates a json response with appropriate header and automatic conversion of arrays.

Response::json(string|array $body = '', int $code = null, bool $pretty = null, array $headers = [ ]): Kirby\Cms\Response

Parameters

Name Type Default
$body string|array ''
$code int null
$pretty bool null
$headers array [ ]

Return type

Kirby\Cms\Response

Parent class

Kirby\Cms\Response inherited from Kirby\Http\Response