// General
Request URL: http://foo.com?x=1&y=2
Request Method: GET
// Query String Parameters
x=1&y=2
当使用get方式请求http时,默认为Query String Parameters
$params = $_GET['params'];
// General
Request URL: http://foo.com
Request Method: POST
// Request Headers
content-type: application/x-www-form-urlencoded; charset=UTF-8
// Form Data
x=1&y=2
当使用post方式请求时默认是为form data
$params = $_POST['params'];
// General
Request URL: http://foo.com
Request Method: POST
// Request Headers
content-type: application/json; charset=UTF-8
// Request Payload
x=1&y=2
当使用post方式请求时,如果设置了content-type是application/json时,返回Request Payload
$params = json_decode(file_get_contents('php://input'),true);