Receiving http status code 406 I have created a custom module in Drupal 8 and added the routing table to mymodule.routing.yml. Whenever I am trying to hit a particular path, I am receiving the HTTP response "406 (406 Not Acceptable)."

What is causing this?
You need to return a Response object or a render array from a controller.