diff --git a/library/think/Request.php b/library/think/Request.php index eac0237f51..47356ecd92 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -526,6 +526,8 @@ public function method($method = false) if (in_array($method, ['GET', 'POST', 'DELETE', 'PUT', 'PATCH'])) { $this->method = $method; $this->{$this->method}($_POST); + } else { + $this->method = 'POST'; } } elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) { $this->method = strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);