/**
*
*/
protected function handleResponse($request)
{
$this->progress->onResponse($this->httpResponse);
$this->createStream($request);
$response = new Response($this->httpResponse->getCode(), $this->httpResponse->getHeaders(), $this->stream, $this->httpResponse->getVersion(), $this->httpResponse->getReasonPhrase());
if (!$this->options['stream']) {
return $request->on('end', function () use($response) {
$this->resolveResponse($response);
});
}
$this->resolveResponse($response);
}