JsonResponse
class JsonResponse extends JsonResponse (View source)
Свойства
| ResponseTrait |
Методы
| int | status() Получить код состояния ответа. | из ResponseTrait |
| string | content() Получить содержимое ответа. | из ResponseTrait |
| $this | header(string $key, string $value, bool $replace = true) Установить заголовок ответа. | из ResponseTrait |
| $this | withHeaders(array $headers) Добавить массив заголовков к ответу. | из ResponseTrait |
| $this | cookie(Cookie|mixed $cookie) Добавить cookie к ответу. | из ResponseTrait |
| $this | withCookie(Cookie|mixed $cookie) Добавить cookie к ответу. | из ResponseTrait |
| throwResponse() Выбрасывает ответ в экземпляре HttpResponseException. | из ResponseTrait | |
| __construct(mixed $data = null, int $status = 200, array $headers = [], int $options) Конструктор. | ||
| mixed | getData(bool $assoc = false, int $depth = 512) Получить данные из ответа, декодированные из JSON. | |
| setData($data = []) {@inheritdoc} | ||
| int | getJsonOptions() Получить параметры кодирования JSON. | |
| setEncodingOptions($encodingOptions) {@inheritdoc} | ||
| mixed | setJsonOptions(int $options) Установить параметры кодирования JSON. |
Детали
int status()
Получить код состояния ответа.
string content()
Получить содержимое ответа.
$this header(string $key, string $value, bool $replace = true)
Установить заголовок ответа.
$this withHeaders(array $headers)
Добавить массив заголовков к ответу.
$this cookie(Cookie|mixed $cookie)
Добавить cookie в ответ.
$this withCookie(Cookie|mixed $cookie)
Добавить cookie в ответ.
throwResponse()
Выбросить ответ в экземпляре HttpResponseException.
__construct(mixed $data = null, int $status = 200, array $headers = [], int $options)
Конструктор.
mixed getData(bool $assoc = false, int $depth = 512)
Получить данные, декодированные из JSON, из ответа.
setData($data = [])
{@inheritdoc}
int getJsonOptions()
Получить опции кодирования JSON.
setEncodingOptions($encodingOptions)
{@inheritdoc}
mixed setJsonOptions(int $options)
Установить опции кодирования JSON.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.2/Illuminate/Http/JsonResponse.html