GuzzleHttp\Exception\RequestException::getRequest PHP Method

getRequest() public method

Get the request that caused the exception
public getRequest ( ) : Psr\Http\Message\RequestInterface
return Psr\Http\Message\RequestInterface
    public function getRequest()
    {
        return $this->request;
    }

Usage Example

 /**
  * Converts a Guzzle exception into an Httplug exception.
  *
  * @param RequestException $exception
  *
  * @return Exception
  */
 private function createException(RequestException $exception)
 {
     if ($exception->hasResponse()) {
         return new HttpException($exception->getMessage(), $exception->getRequest(), $exception->getResponse(), $exception);
     }
     return new NetworkException($exception->getMessage(), $exception->getRequest(), $exception);
 }
All Usage Examples Of GuzzleHttp\Exception\RequestException::getRequest