Merge pull request #375 from supermp/master

让Request支持json方式的POST
This commit is contained in:
ThinkPHP
2016-11-29 16:04:26 +08:00
committed by GitHub

View File

@@ -686,7 +686,12 @@ class Request
public function post($name = '', $default = null, $filter = '')
{
if (empty($this->post)) {
$this->post = $_POST;
$content = $this->input;
if (empty($_POST) && strpos($content, '":')) {
$this->post = json_decode($content, true);
} else {
$this->post = $_POST;
}
}
if (is_array($name)) {
$this->param = [];