public static function detect_method($origMethod, $postVars)
    {
        if (isset($postVars['_method'])) {
            if (!in_array(strtoupper($postVars['_method']), array('GET','POST','PUT','DELETE','HEAD'))) {
                user_error('HTTPRequest::detect_method(): Invalid "_method" parameter', E_USER_ERROR);
            }
            return strtoupper($postVars['_method']);
        } else {
            return $origMethod;
        }
    }