public function send()
    {
        // Sanity check for URL
        if (!$this->url instanceof Net_URL2
            || !$this->url->isAbsolute()
            || !in_array(strtolower($this->url->getScheme()), array('https', 'http'))
        ) {
            throw new HTTP_Request2_LogicException(
                'HTTP_Request2 needs an absolute HTTP(S) request URL, '
                . ($this->url instanceof Net_URL2
                   ? "'" . $this->url->__toString() . "'" : 'none')
                . ' given',
                HTTP_Request2_Exception::INVALID_ARGUMENT
            );
        }
        if (empty($this->adapter)) {
            $this->setAdapter($this->getConfig('adapter'));
        }
        // magic_quotes_runtime may break file uploads and chunked response
        // processing; see bug #4543. Don't use ini_get() here; see bug #16440.
        if ($magicQuotes = get_magic_quotes_runtime()) {
            set_magic_quotes_runtime(false);
        }
        // force using single byte encoding if mbstring extension overloads
        // strlen() and substr(); see bug #1781, bug #10605
        if (extension_loaded('mbstring') && (2 & ini_get('mbstring.func_overload'))) {
            $oldEncoding = mb_internal_encoding();
            mb_internal_encoding('8bit');
        }

        try {
            $response = $this->adapter->sendRequest($this);
        } catch (Exception $e) {
        }
        // cleanup in either case (poor man's "finally" clause)
        if ($magicQuotes) {
            set_magic_quotes_runtime(true);
        }
        if (!empty($oldEncoding)) {
            mb_internal_encoding($oldEncoding);
        }
        // rethrow the exception
        if (!empty($e)) {
            throw $e;
        }
        return $response;
    }
public function send()
    {
        // Sanity check for URL
        if (!$this->url instanceof Net_URL2
            || !$this->url->isAbsolute()
            || !in_array(strtolower($this->url->getScheme()), array('https', 'http'))
        ) {
            throw new HTTP_Request2_LogicException(
                'HTTP_Request2 needs an absolute HTTP(S) request URL, '
                . ($this->url instanceof Net_URL2
                   ? "'" . $this->url->__toString() . "'" : 'none')
                . ' given',
                HTTP_Request2_Exception::INVALID_ARGUMENT
            );
        }
        if (empty($this->adapter)) {
            $this->setAdapter($this->getConfig('adapter'));
        }
        // magic_quotes_runtime may break file uploads and chunked response
        // processing; see bug #4543. Don't use ini_get() here; see bug #16440.
        if ($magicQuotes = get_magic_quotes_runtime()) {
            set_magic_quotes_runtime(false);
        }
        // force using single byte encoding if mbstring extension overloads
        // strlen() and substr(); see bug #1781, bug #10605
        if (extension_loaded('mbstring') && (2 & ini_get('mbstring.func_overload'))) {
            $oldEncoding = mb_internal_encoding();
            mb_internal_encoding('8bit');
        }

        try {
            $response = $this->adapter->sendRequest($this);
        } catch (Exception $e) {
        }
        // cleanup in either case (poor man's "finally" clause)
        if ($magicQuotes) {
            set_magic_quotes_runtime(true);
        }
        if (!empty($oldEncoding)) {
            mb_internal_encoding($oldEncoding);
        }
        // rethrow the exception
        if (!empty($e)) {
            throw $e;
        }
        return $response;
    }
public function send ( ) { // Sanity check for URL
 if ( ! $ this -> url instanceof Net_URL2 || ! $ this -> url -> isAbsolute ( ) || ! in_array ( strtolower ( $ this -> url -> getScheme ( ) ) , array ( 'https' , 'http' ) ) ) { throw new HTTP_Request2_LogicException ( 'HTTP_Request2 needs an absolute HTTP(S) request URL, ' . ( $ this -> url instanceof Net_URL2 ? "'" . $ this -> url -> __toString ( ) . "'" : 'none' ) . ' given' , HTTP_Request2_Exception :: INVALID_ARGUMENT ) ; } if ( empty ( $ this -> adapter ) ) { $ this -> setAdapter ( $ this -> getConfig ( 'adapter' ) ) ; } // magic_quotes_runtime may break file uploads and chunked response
 // processing; see bug #4543. Don't use ini_get() here; see bug #16440.
 if ( $ magicQuotes = get_magic_quotes_runtime ( ) ) { set_magic_quotes_runtime ( false ) ; } // force using single byte encoding if mbstring extension overloads
 // strlen() and substr(); see bug #1781, bug #10605
 if ( extension_loaded ( 'mbstring' ) && ( 2 & ini_get ( 'mbstring.func_overload' ) ) ) { $ oldEncoding = mb_internal_encoding ( ) ; mb_internal_encoding ( '8bit' ) ; } try { $ response = $ this -> adapter -> sendRequest ( $ this ) ; } catch ( Exception $ e ) { } // cleanup in either case (poor man's "finally" clause)
 if ( $ magicQuotes ) { set_magic_quotes_runtime ( true ) ; } if ( ! empty ( $ oldEncoding ) ) { mb_internal_encoding ( $ oldEncoding ) ; } // rethrow the exception
 if ( ! empty ( $ e ) ) { throw $ e ; } return $ response ; }
Sends the request and returns the response

@throws   HTTP_Request2_Exception
@return   HTTP_Request2_Response
Sends the request and returns the response