FriendsOfSymfony / FOSRestBundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony
http://symfony.com/doc/master/bundles/FOSRestBundle/index.html
MIT License
2.79k stars 704 forks source link

POST method should not throw exception on empty payload without content-type #2297

Open fliespl opened 3 years ago

fliespl commented 3 years ago

Content-Type header field is used to specify type of data in the body request.

When request is sent with an empty payload - it should be accepted the same way as DELETE request, cause in such cases Content-Type header is not applicable.

goetas commented 2 years ago

hi, thanks for your PR. this makes sense to me.

could you add a test for this please?