Home  >  Q&A  >  body text

Laravel doesn't read POST request with FormData

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粉046387133P粉046387133181 days ago364

reply all(1)I'll reply

  • P粉593118425

    P粉5931184252024-03-27 09:39:37

    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.

    reply
    0
  • Cancelreply