PHPResponse
Implements
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Parameters
httpStatusCode: number
headers: Record<string, string[]>
body: ArrayBuffer
errors: string = ''
exitCode: number = 0
Returns PHPResponse
Properties
readonlybytes
Response body. Contains the output from echo
,
print
, inline HTML etc.
readonlyerrors
Stderr contents, if any.
readonlyexitCode
The exit code of the script. 0
is a success, while
1
and 2
indicate an error.
readonlyheaders
Response headers.
readonlyhttpStatusCode
Response HTTP status code, e.g. 200.
Accessors
json
Response body as JSON.
Returns any
text
Response body as text.
Returns string
Methods
toRawData
Returns PHPResponseData
staticforHttpCode
Parameters
httpStatusCode: number
text: string = ''
Returns PHPResponse
staticfromRawData
Parameters
data: PHPResponseData
Returns PHPResponse
PHP response. Body is an
ArrayBuffer
because it can contain binary data.This type is used in Comlink.transferHandlers.set(‘PHPResponse’, { … }) so be sure to update that if you change this type.