As explained in How to render plain JSON (without any additional tag) data in DXA 1.5 java?, it is possible to retrieve the contents of a page as JSON by adding ?format=json to the URL. I've tried that in DXA 2, and it still works fine.
However, it is also claimed that you can achieve the same result by sending an Accept header with value 'application/json'. This does not work for me. Do I need to send another header as well? Or was this feature removed in DXA 2?