php - Please ask. . How to get formdata data submitted by post in laravel
迷茫
迷茫 2017-05-16 12:59:50
0
4
1579

Please be clear when writing, this is API, post data submitted by a third party,

I don’t know what data form-data will send.

So what I want is to get all the data submitted through POST form-data.

Normally speaking, $request->all gets all the data from the front desk,

However, if it is submitted by a third party, using $request->all cannot directly obtain the form-data data.

The winner said that I haven’t found a way to get form-data directly

Now you can only use the native method to get it..

I solved it myself. $request->all can get the data submitted by the third party through GET, but cannot get it through POST. You can use getcontent to get it.

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(4)
曾经蜡笔没有小新

I did it myself. None of the methods you mentioned can work. request->all obtains get. Post cannot be obtained by this method. You need to use getcount. I don’t know how you feel about those few points. It doesn’t matter. I took care of it myself.

给我你的怀抱

can be accessed via Request 对象来获取。
如获取表单全部数据, $request->all()
获取表单中键名为name的字段,$request->get('name') .
For detailed information, please refer to the official documentation.

阿神

I wrote a Demo on GitHub, you can take a look. https://github.com/MhcII/Form...

$request->all() can still be retrieved. I just tested this code and it works.

foreach ($request->all() as $key=>$param) {
    if (is_object($param)) {
        // 这里是 file
    } else {
        // 这里是 text
    }
}
黄舟
$request->all(); // 获取form表单中的所有字段值
$request->input('name'); // 获取form表单中输入框name='name'的字段值
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template