Is it possible to add custom HTTP headers to every layer request (p.e. WMTSLayer)? I'd like to add the referer header because otherwise the WMTS Service doesn't delivier the image.
In 3.x you can use esriRequest.setRequestPreCallback()
This will let you modify the request before it is sent.
Unfortunately I wasn't able to alter the Referer item (translated to English):
"Attempt to use a forbidden header was rejected: Referer"
Retrieving data ...