Exemple #1
0
 /**
  * Takes a response and stocks common values from both the body and the headers.
  *
  * @param Response $response
  * @return $this
  */
 public function populateFromResponse(Response $response)
 {
     $this->content = $response->getBody();
     $headers = $response->getHeaders();
     return $this->setMetadata($headers, true)->setContentType((string) $headers['Content-type'])->setLastModified((string) $headers['Last-Modified'])->setContentLength((string) $headers['Content-Length'])->setEtag((string) $headers['ETag']);
 }