\ManaPHP\SocketResponseInterface

Summary

Methods
Constants
getContext()
setContent()
setJsonOk()
setJsonError()
setJsonData()
setJsonContent()
getContent()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

setContent()

setContent(string  $content) : static

Sets HTTP response body

Parameters

string $content

Returns

static

setJsonOk()

setJsonOk(string  $message = '') : static

Parameters

string $message

Returns

static

setJsonError()

setJsonError(string  $message, integer  $code = 1) : static

Parameters

string $message
integer $code

Returns

static

setJsonData()

setJsonData(mixed  $data, string  $message = '') : static

Parameters

mixed $data
string $message

Returns

static

setJsonContent()

setJsonContent(array|\JsonSerializable|string|\Exception  $content) : static

Sets HTTP response body. The parameter is automatically converted to JSON

Parameters

array|\JsonSerializable|string|\Exception $content

Returns

static

getContent()

getContent() : string

Gets the HTTP response body

Returns

string