Here I have this sample fiddle, where I try to get only the content-type header from a large image, using both XMLHttpRequest() an
content-type
XMLHttpRequest()
You need to specify the method type of HEAD:
HEAD
fetch(url, {method: 'HEAD'})
See updated fiddle