I'm using javascript's XMLHttpRequest to receive data from Github API and I am trying to use the custom media type specification but can't get it to work. Setting the Accept header doesn't change the format of the response at all. The result I get is always the default (JSON).
This is the code I'm using to make the request:
var url = "https://api.github.com/repos/mrdoob/three.js/issues/comments/241553390";
var xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.setRequestHeader("Accept", "application/vnd.github.v3.raw");
xhr.setRequestHeader("Content-Type","application/vnd.github.v3.raw");
xhr.onload = function(ev) {
console.log("Response:", ev.target.response);
console.log("Headers:", xhr.getAllResponseHeaders());
};
xhr.send();