$body =
$response instanceof StreamableInterface ?
$response->
toStream(false
) : StreamWrapper::
createResource($response,
$this->client
);
$body =
$this->streamFactory->
createStreamFromResource($body);
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);
}