PATCH和PUT请求不适用于表单数据 [英] PATCH and PUT Request Does not Working with form-data

查看:278
本文介绍了PATCH和PUT请求不适用于表单数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Laravel创建RESTFUL应用程序,并使用Postman测试该应用程序.当前,如果从邮递员发送的带有表单数据的数据存在PATCHPUT的问题.

I am using Laravel to create a RESTFUL application and I test the application with Postman. Currently, there is an issue for PATCH or PUT if the data sent from Postman with form-data.

// Parameter `{testimonial}` will be sent to backend.
Route::post  ('testimonials/{testimonial}', 'TestimonialController@update');

// Parameter `{testimonial}` will not be sent to backend (`$request->all()` will be empty) if sent from Postman with form-data.
Route::patch ('testimonials/{testimonial}', 'TestimonialController@update');
Route::put   ('testimonials/{testimonial}', 'TestimonialController@update');

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆