Method | Description | |
---|---|---|
__construct ( mixed $data, integer $status = 200, array $headers = [], integer $encodingOptions = self::DEFAULT_JSON_FLAGS ) | Create a JSON response with the given data. |
Method | Description | |
---|---|---|
jsonEncode ( mixed $data, integer $encodingOptions ) : string | Encode the provided data to JSON. |
public __construct ( mixed $data, integer $status = 200, array $headers = [], integer $encodingOptions = self::DEFAULT_JSON_FLAGS ) | ||
$data | mixed | Data to convert to JSON. |
$status | integer | Integer status code for the response; 200 by default. |
$headers | array | Array of headers to use at initialization. |
$encodingOptions | integer | JSON encoding options to use. |