Description
I've asked @nicolas-grekas on Twitter and it felt like he wasn't sure, so I investigated a little bit more and found the following sentence in the specs:
According to https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2:
The content type "multipart/form-data" should be used for submitting forms that contain files, non-ASCII data, and binary data.
In my opinion, Request::getContentType()
, or much rather Request::initializeFormats()
should map multipart/form-data
to form
, as it's per-spec related to submitting forms with mixed data. Right now the behaviour is to return null
, which is confusing and cumbersome when you have a controller action that is called via a regular POST
and via fetch
+ new FormData()
as body from your frontend.
I'd be very happy to file a PR to add it to the mapping.
Opinions?