Return results
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
1 The following js will report out of date
axios.post('/api/code/create', this.formItem)
2 The following js will not report an error
axios.post('/api/code/create', window.qs.stringify(this.formItem))
But using method 2, the boolean data in this.formItem will become "True" / "False"
As a result, fields with field type bool in mysql cannot be saved as "True" when stored in the database. The corresponding 1 is always 0
I don’t want to modify php.ini, I use laravel5.2
Code to get data
Input::all();
How to avoid errors and store them correctly? If using php://input, how to modify it?
Not POST forms are obsolete. Did you use software to do the translation?
This sentence means that the
$HTTP_RAW_POST_DATA
constant is obsolete and will be removed in the next version.But this version still exists, and this is a warning.
The solution is given below.
2 types:
In the php.ini configuration file, set
always_populate_raw_post_data
to-1
Don’t use
$HTTP_RAW_POST_DATA
, use php://input instead.