3๐
โ
I finally found the solution I needed here:
let message = String.fromCharCode.apply(
null,
new Uint8Array(errorResponse.body));
However, because Iโm using TypeScript I was getting some kind of annoying message about errorResponse.body
not being assignable to type number[]
, so Iโm doing it like this:
let message = String.fromCharCode.apply(
null,
new Uint8Array(errorResponse.body) as any);
Also note that because my response body had an odd number of characters, I had to use Uint8Array
instead of Uint16Array
. See this helpful answer for details.
๐คBassie
Source:stackexchange.com