We should not try to transform responses that we know are not JSON. E.g.,
const fetchTemplate = createRequest('fetchTemplate', () => ({
url: '/template/contents',
headers: {
Accept: 'binary/octet-stream',
}
})
A workaround does exist for this -- you can pass parseJsonStrictly: false as a configuration option. The response will still be attempted to be parsed as json, but when it fails the response body should be returned as text.
It's possible that for this case we shouldn't try to transform the body at all (even via .text()) so that the client can do whatever they want with it