RequestException
PSR-18 malformed-request failure: the request itself is not a well-formed HTTP request and could not even be attempted (e.g.
an unusable/empty URI). Not retried — retrying a malformed request can’t help.
Synopsis
Section titled “Synopsis”final class RequestException extends TransportException implements RequestExceptionInterface
| Extends | TransportException |
| Implements | RequestExceptionInterface |
| Source | Http/Client/Exception/RequestException.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(string $message, RequestInterface $request, ?Throwable $previous = null): mixed
| Parameter | Type | Description |
|---|---|---|
$message | string | |
$request | RequestInterface | |
$previous | ?Throwable |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
getRequest(): RequestInterface | Returns the malformed request that was rejected, as handed to the constructor. |
getRequest()
Section titled “getRequest()”public function getRequest(): RequestInterface
Returns the malformed request that was rejected, as handed to the constructor.
Returns RequestInterface
Inherited methods
Section titled “Inherited methods”These come from an ancestor and are documented where they are declared.
| Method | Declared in | Description |
|---|---|---|
getCode() | Exception | |
getFile() | Exception | |
getLine() | Exception | |
getMessage() | Exception | |
getPrevious() | Exception | |
getTrace() | Exception | |
getTraceAsString() | Exception |