ApiException
extends Exception
in package
ApiException Class Doc Comment.
Tags
Table of Contents
Properties
- $responseBody : null|stdClass|string
- The HTTP body of the server response either as Json or string.
- $responseHeaders : null|array<string|int, array<string|int, string>>
- The HTTP header of the server response.
- $responseObject : null|array<string|int, mixed>|stdClass|string
- The deserialized response object.
Methods
- __construct() : mixed
- Constructor.
- getResponseBody() : null|stdClass|string
- Gets the HTTP body of the server response either as Json or string.
- getResponseHeaders() : null|array<string|int, array<string|int, string>>
- Gets the HTTP response header.
- getResponseObject() : mixed
- Gets the deserialized response object (during deserialization).
- setResponseObject() : void
- Sets the deserialized response object (during deserialization).
Properties
$responseBody
The HTTP body of the server response either as Json or string.
protected
null|stdClass|string
$responseBody
$responseHeaders
The HTTP header of the server response.
protected
null|array<string|int, array<string|int, string>>
$responseHeaders
$responseObject
The deserialized response object.
protected
null|array<string|int, mixed>|stdClass|string
$responseObject
Methods
__construct()
Constructor.
public
__construct([string $message = '' ][, int $code = 0 ][, null|array<string|int, array<string|int, string>> $responseHeaders = [] ][, null|stdClass|string $responseBody = null ]) : mixed
Parameters
- $message : string = ''
-
Error message
- $code : int = 0
-
HTTP status code
- $responseHeaders : null|array<string|int, array<string|int, string>> = []
-
HTTP response header
- $responseBody : null|stdClass|string = null
-
HTTP decoded body of the server response either as \stdClass or string
getResponseBody()
Gets the HTTP body of the server response either as Json or string.
public
getResponseBody() : null|stdClass|string
Return values
null|stdClass|string —HTTP body of the server response either as \stdClass or string
getResponseHeaders()
Gets the HTTP response header.
public
getResponseHeaders() : null|array<string|int, array<string|int, string>>
Return values
null|array<string|int, array<string|int, string>> —HTTP response header
getResponseObject()
Gets the deserialized response object (during deserialization).
public
getResponseObject() : mixed
Return values
mixed —the deserialized response object
setResponseObject()
Sets the deserialized response object (during deserialization).
public
setResponseObject(mixed $obj) : void
Parameters
- $obj : mixed
-
Deserialized response object