[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/laminas/laminas-diactoros/src/Response/ -> JsonResponse.php (summary)

(no description)

Copyright: https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md
License: https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License
File Size: 184 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

JsonResponse:: (9 methods):
  __construct()
  getPayload()
  withPayload()
  getEncodingOptions()
  withEncodingOptions()
  createBodyFromJson()
  jsonEncode()
  setPayload()
  updateBodyFor()


Class: JsonResponse  - X-Ref

JSON response.

Allows creating a response by passing data to the constructor; by default,
serializes the data to JSON, sets a status code of 200 and sets the
Content-Type header to application/json.
__construct($data,int $status = 200,array $headers = [],int $encodingOptions = self::DEFAULT_JSON_FLAGS)   X-Ref
Create a JSON response with the given data.

Default JSON encoding is performed with the following options, which
produces RFC4627-compliant JSON, capable of embedding into HTML.

- JSON_HEX_TAG
- JSON_HEX_APOS
- JSON_HEX_AMP
- JSON_HEX_QUOT
- JSON_UNESCAPED_SLASHES

param: mixed $data Data to convert to JSON.
param: int $status Integer status code for the response; 200 by default.
param: array $headers Array of headers to use at initialization.
param: int $encodingOptions JSON encoding options to use.

getPayload()   X-Ref

return: mixed

withPayload($data)   X-Ref

param: mixed $data

getEncodingOptions()   X-Ref
No description

withEncodingOptions(int $encodingOptions)   X-Ref
No description

createBodyFromJson(string $json)   X-Ref
No description

jsonEncode($data, int $encodingOptions)   X-Ref
Encode the provided data to JSON.

param: mixed $data

setPayload($data)   X-Ref

param: mixed $data

updateBodyFor(JsonResponse $toUpdate)   X-Ref
Update the response body for the given instance.

param: self $toUpdate Instance to update.
return: JsonResponse Returns a new instance with an updated body.



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer