Skip to content

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.

final class RequestException extends TransportException implements RequestExceptionInterface

ExtendsTransportException
ImplementsRequestExceptionInterface
SourceHttp/Client/Exception/RequestException.php

public function __construct(string $message, RequestInterface $request, ?Throwable $previous = null): mixed

ParameterTypeDescription
$messagestring
$requestRequestInterface
$previous?Throwable

Returns mixed

MethodDescription
getRequest(): RequestInterfaceReturns the malformed request that was rejected, as handed to the constructor.

public function getRequest(): RequestInterface

Returns the malformed request that was rejected, as handed to the constructor.

Returns RequestInterface

These come from an ancestor and are documented where they are declared.

MethodDeclared inDescription
getCode()Exception
getFile()Exception
getLine()Exception
getMessage()Exception
getPrevious()Exception
getTrace()Exception
getTraceAsString()Exception