This isn’t a real article it is a link to an article that explains this process. This way I can find this information again later when I need it and also google can find this question for others in the future and they can find the Symfony cast with the info they need. And…. this is now one of the most popular articles on the site. LOL

I found this bit of interesting information in this SymfonyCast here. I had wondered about this when I was creating AJAX calls to Symfony routes.
I was playing with the new Javascript Fetch API and with sending accepted response types. In the end I decided to leave all that off and just get what is returned.
Read the linked SymfonyCast section to get an understanding of the steps/process Symfony is using to decide what content type to return in the headers.
I’d suggest reading that entire SymfonyCast it contains a hell of a lot of useful information.
Comments
One response to “How does Symfony decide what content type to return in a response?”
[…] How does Symfony decide what content type to return in a response? […]
You must log in to post a comment.