HttpException
extends Exception
in package
Raised when the server responds with an HTTP error code.
Table of Contents
- $request : mixed
- $response : mixed
- __construct() : mixed
- Create an HttpException.
- __set() : mixed
- The magic setter is overridden to insure immutability.
- getReasonPhrase() : string
- This is basically a shortcut for getResponse()->getReasonPhrase().
- getRequest() : Request
- getResponse() : Response
- getResponseBody() : string
- This is basically a shortcut for (string) getResponse()->getBody().
- getResponseResource() : resource
- The response message body may be a string representation of a Resource representing the error.
- getStatusCode() : string
- This is basically a shortcut for for getResponse()->getStatusCode().
Properties
$request
private
mixed
$request
$response
private
mixed
$response
Methods
__construct()
Create an HttpException.
public
__construct(Request $request, Response $response) : mixed
Parameters
- $request : Request
-
The HTTP request
- $response : Response
-
The HTTP response
Return values
mixed —__set()
The magic setter is overridden to insure immutability.
public
__set( $name, $value) : mixed
Parameters
Return values
mixed —getReasonPhrase()
This is basically a shortcut for getResponse()->getReasonPhrase().
public
getReasonPhrase() : string
Return values
string —the HTTP reason phrase
getRequest()
public
getRequest() : Request
Return values
Request —the HTTP request causing the Exception
getResponse()
public
getResponse() : Response
Return values
Response —the HTTP response causing the Exception
getResponseBody()
This is basically a shortcut for (string) getResponse()->getBody().
public
getResponseBody() : string
Return values
string —the response body
getResponseResource()
The response message body may be a string representation of a Resource representing the error.
public
getResponseResource() : resource
This is basically a shortcut for Resource::fromJson(getResponseBody()).
Return values
resource —the Resource returned by the response (may be empty)
getStatusCode()
This is basically a shortcut for for getResponse()->getStatusCode().
public
getStatusCode() : string
Return values
string —the HTTP status code