public function request($method, $url, array $data = array(), array $extra = array())
    {
        switch (strtoupper($method)) {
            case 'POST':
                return $this->post($url, $data, $extra);
            case 'GET':
                return $this->get($url, $data, $extra);
            case 'PATCH':
                return $this->patch($url, $data, $extra);
            case 'HEAD':
                return $this->head($url, $data, $extra);
            case 'PUT':
                return $this->put($url, $data, $extra);
            case 'DELETE':
                return $this->delete($url, $data, $extra);
            default:
                throw new UnexpectedValueException(sprintf('Unsupported or unknown HTTP method provided "%s"', $method));
        }
    }
public function request($method, $url, array $data = array(), array $extra = array())
    {
        switch (strtoupper($method)) {
            case 'POST':
                return $this->post($url, $data, $extra);
            case 'GET':
                return $this->get($url, $data, $extra);
            case 'PATCH':
                return $this->patch($url, $data, $extra);
            case 'HEAD':
                return $this->head($url, $data, $extra);
            case 'PUT':
                return $this->put($url, $data, $extra);
            case 'DELETE':
                return $this->delete($url, $data, $extra);
            default:
                throw new UnexpectedValueException(sprintf('Unsupported or unknown HTTP method provided "%s"', $method));
        }
    }
public function request ( $ method , $ url , array $ data = array ( ) , array $ extra = array ( ) ) { switch ( strtoupper ( $ method ) ) { case 'POST' : return $ this -> post ( $ url , $ data , $ extra ) ; case 'GET' : return $ this -> get ( $ url , $ data , $ extra ) ; case 'PATCH' : return $ this -> patch ( $ url , $ data , $ extra ) ; case 'HEAD' : return $ this -> head ( $ url , $ data , $ extra ) ; case 'PUT' : return $ this -> put ( $ url , $ data , $ extra ) ; case 'DELETE' : return $ this -> delete ( $ url , $ data , $ extra ) ; default : throw new UnexpectedValueException ( sprintf ( 'Unsupported or unknown HTTP method provided "%s"' , $ method ) ) ; } }
Performs a HTTP request

@param string $method
@param string $url Target URL
@param array $data Data to be sent
@param array $extra Extra options
@param \UnexpectedValueException If unknown HTTP method provided
@return mixed
Performs a HTTP request