Drupal core no longer uses accept headers for routing but rather rely on a
_format query parameter, because browser, (reverse) proxy and CDN support is very poor, and hence could lead to severe bugs. See for more background.
This is an example to a hal_json request
curl -i http://d8.dev/node/1 -H "Accept: application/hal_json"
curl -i http://d8.dev/node/1?_format=hal_json
This also leads to changed PHP api.
So if you want to link to a specific format you can now do that:
$url = Url::fromRoute('example_route')->setOption('query', ['_format' => 'hal_json']);