Reference

Guide

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\Http\Response

Parameters

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

Return type

Kirby\Http\Response

Source code

kirby/src/Http/Response.php#L234