if ($body->
isSeekable()) { $body->
seek(0
);
} return $psrResponse->
withBody($body);
} catch (TransportExceptionInterface
$e) { if ($e instanceof \InvalidArgumentException
) { throw new Psr18RequestException($e,
$request);
} throw new Psr18NetworkException($e,
$request);
} } public function createRequest(string
$method,
$uri): RequestInterface
{ if ($this->responseFactory instanceof RequestFactoryInterface
) { return $this->responseFactory->
createRequest($method,
$uri);
} if (class_exists(Psr17FactoryDiscovery::
class)) { return Psr17FactoryDiscovery::
findRequestFactory()->
createRequest($method,
$uri);
}