Thinkphp5.1 $this- > request- > isPost () question

$this- > request- > isPost () uses $.post (target, query) .success (function (data) {
in
receiving empty data to report the following error

Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set "always_populate_raw_post_data" to "-1" in php.ini and use the php://input stream instead. in Unknown on line 0
Mar.12,2021

solution
the data parameter passed to the backend when the front-end page initiates $.post must not be given a value

$.ajax({
    type:'POST',
    url:'url',
    data:{a:'123'},// 
})

$this- > request- > isPost ();
request ()-> isPost ();
both of the above are used to detect whether it is a POST request

accept parameters:

input(); // 
input('post.','') //post '';
input('post.name','') //postname 

you can also use:

$this->request->post('name','');
request()->post('name','');
Menu