Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The issue with Symfony 3.4 that causes a plain text header to be returned with a JSON response is related to a change in the default behavior of the JsonResponse class. In previous versions of Symfony, the JsonResponse class would set the content type header to "application/json" by default. However, starting with Symfony 3.4, the default content type header was changed to "text/html". This causes an issue when trying to return JSON responses because some clients may not recognize the "text/html" content type header and treat the response as plain text, leading to errors or unexpected results.