Laravel doesn't read POST request with FormData
P粉046387133
P粉046387133 2024-03-26 12:24:52
0
1
399

dd(Request::instance()->getContent()); Statement display:

"
----------------------------545652777124128130660951\r\n
Content-Disposition: form-data; name="firstname"\r\n
\r\n
fakeName\r\n
----------------------------545652777124128130660951--\r\n
"

Requests are sent by postman.

title:

'Content-type': 'application/json',

'Accept': 'application/json, text/plain'

question:

Request::instance()->all(); Returns an empty array. Why?

P粉046387133
P粉046387133

reply all(1)
P粉593118425

oops
Here is the fix:
Change this header:
Content-type: multipart/form-data; border=
This is set by the postman.
This title should not be touched.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!