final class JsonResponse implements IResponse

JSON response used mainly for AJAX requests.

Methods

__construct($payload, string $contentType = null)

No description

mixed
getPayload()

No description

string
getContentType()

Returns the MIME content type of a downloaded file.

void
send(IRequest $httpRequest, IResponse $httpResponse)

Sends response to output.

Details

at line 29
__construct($payload, string $contentType = null)

No description

Parameters

$payload
string $contentType

at line 39
mixed getPayload()

No description

Return Value

mixed

at line 48
string getContentType()

Returns the MIME content type of a downloaded file.

Return Value

string

at line 57
void send(IRequest $httpRequest, IResponse $httpResponse)

Sends response to output.

Parameters

IRequest $httpRequest
IResponse $httpResponse

Return Value

void

Traits

Strict class for better experience.