コード例 #1
0
ファイル: Technorati.php プロジェクト: robertodormepoco/zf2
 /**
  * Checks ReST response for errors.
  *
  * @param   Response $response    the ReST response
  * @return  void
  * @throws  Exception\RuntimeException
  * @access  protected
  */
 protected static function checkResponse(HttpResponse $response)
 {
     if ($response->isServerError() || $response->isClientError()) {
         throw new Exception\RuntimeException(sprintf('Invalid response status code (HTTP/%s %s %s)', $response->getVersion(), $response->getStatus(), $response->getMessage()));
     }
 }
コード例 #2
0
ファイル: Client.php プロジェクト: hnw/Goutte
 protected function createResponse(ZendResponse $response)
 {
     return new Response($response->getBody(), $response->getStatus(), $response->getHeaders());
 }