返回结果
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 如下的js会报过时
axios.post('/api/code/create', this.formItem)
2 如下的js不会报错
axios.post('/api/code/create', window.qs.stringify(this.formItem))
但是使用方法 2 的方式,this.formItem中的boolean数据会变成 "True" / "False"
导致存入数据库时 mysql 中字段类型为bool的字段无法将"True" 存为对应的 1 ,而始终是0
不想用修改php.ini这种方式,我使用的laravel5.2
获取数据的代码
Input::all();
该如何又避免报错,又能正确存储 ? 如果使用php://input 的方式,该如何修改?
www说
相关分类