Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何捕获邮递员通过表单数据发送到laravel控制器的数据_Php_Laravel_Postman - Fatal编程技术网

Php 如何捕获邮递员通过表单数据发送到laravel控制器的数据

Php 如何捕获邮递员通过表单数据发送到laravel控制器的数据,php,laravel,postman,Php,Laravel,Postman,我可以捕获以JSON格式发送的数据,但当我通过表单数据发送数据时,它会输出以下内容 { "status": "error", "status_code": 422, "message": "Fields Validation Failed.", "data": { "email": [ "The email field is required." ], "password": [

我可以捕获以JSON格式发送的数据,但当我通过表单数据发送数据时,它会输出以下内容

{
    "status": "error",
    "status_code": 422,
    "message": "Fields Validation Failed.",
    "data": {
        "email": [
            "The email field is required."
        ],
        "password": [
            "The password field is required."
        ]
    }
}

您需要将字段放在“body”中,将字段的值放在“value”中。

我做了这个body->form data->key and valuepair@AnkitBihani好了。我的控制器是公共函数身份验证(请求$Request){$rules=array('email'=>'required | email','password'=>'required',);$validator=validator::make($request->all(),$rules);if($validator->failes()){return$this->respondValidationError('Fields Validation Failed',$validator->errors());}