简体   繁体   中英

Laravel PUT not receiving parameters/request

I am using laravel 5.1 and I have encountered a strange issue. I am unable to receive parameter with PUT method.

Tool :

POSTMAN (extension for chrome)

My Route

Route::put('testing_put',function(Request $r){
    print_r($r);
});

Output

Illuminate\Support\Facades\Request Object ( )

在此输入图像描述

The solution was simple!

Change POSTMAN from form-data to x-form-www-urlencoded

在POSTMAN中更改此项,然后发送

You are type-hinting the Illuminate Facade. Try changing use Illuminate\\Support\\Facades\\Request to use Illuminate\\Http\\Request .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM