Sending data to the server for updating using the PUT method. The data is sent using FormData. The data is sent, it is visible in Chrome, but the server does not see the data.
$request = $request->all() With the POST method, everything works fine. Sending text data and file
How do I update the data? Redo routes under the POST method?
UPD
In Controller, I meanwhile, just trying to get a response from the server
public function update(Request $request, $id) { $request = $request->all(); dd($request); } This method works if you send data in POST format, then everything works fine. I use instead of vue-resource axios
save() { var vm = this var form = document.querySelector('form'); var formdata = new FormData(form) axios[this.method](this.store, formdata) .then(function (response) { if (response.data.saved) { vm.$router.push(vm.redirect) } }) .catch(function (error) { console.log(error) }) } By the way, if I write $reqyest->getContent() , then I will receive the data in this format, but how can I process it?
b""" ------WebKitFormBoundaryFEIpstOEw72VwaAe\r\n Content-Disposition: form-data; name="name"\r\n \r\n Moscow\r\n ------WebKitFormBoundaryFEIpstOEw72VwaAe\r\n Content-Disposition: form-data; name="cost"\r\n \r\n 1.00\r\n ------WebKitFormBoundaryFEIpstOEw72VwaAe\r\n Content-Disposition: form-data; name="picture"; filename="angel.png"\r\n Content-Type: image/png\r\n \r\n ...HIDEN... ------WebKitFormBoundaryFEIpstOEw72VwaAe\r\n Content-Disposition: form-data; name="description"\r\n \r\n <p>1</p>\r\n \r\n ------WebKitFormBoundaryFEIpstOEw72VwaAe--\r\n """