Exemple #1
0
 /**
  * Gets the HTTP response
  * 
  * @return  Woops_Http_Response         The HTTP response object
  * @throws  Woops_Http_Client_Exception If the connection was not established
  */
 public function getResponse()
 {
     // Checks the connect flag
     if (!$this->_connected) {
         // No connection
         throw new Woops_Http_Client_Exception('The connection has not been established yet', Woops_Http_Client_Exception::EXCEPTION_NOT_CONNECTED);
     }
     // Checks if the reponse object already exist
     if (!is_object($this->_response)) {
         // Creates the response object
         $this->_response = Woops_Http_Response::createResponseObject($this->_socket);
     }
     // Returns the response object
     return $this->_response;
 }