{"record":{"id":"16450a083f6b374e","repo":"dotnet/aspnetcore","slug":"responsetype-is-not-supported","errorCode":null,"errorMessage":"${responseType} is not supported.","messagePattern":"(.+?) is not supported\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/SignalR/clients/ts/signalr/src/FetchHttpClient.ts","lineNumber":178,"sourceCode":"            this._jar.getCookies(url, (e, c) => cookies = c.join(\"; \"));\n        }\n        return cookies;\n    }\n}\n\nfunction deserializeContent(response: Response, responseType?: XMLHttpRequestResponseType): Promise<string | ArrayBuffer> {\n    let content;\n    switch (responseType) {\n        case \"arraybuffer\":\n            content = response.arrayBuffer();\n            break;\n        case \"text\":\n            content = response.text();\n            break;\n        case \"blob\":\n        case \"document\":\n        case \"json\":\n            throw new Error(`${responseType} is not supported.`);\n        default:\n            content = response.text();\n            break;\n    }\n\n    return content;\n}\n","sourceCodeStart":160,"sourceCodeEnd":186,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/3600ca084e9c8b5f4174fc5e747f4c52d2100806/src/SignalR/clients/ts/signalr/src/FetchHttpClient.ts#L160-L186","documentation":"deserializeContent switches on the request's responseType and explicitly rejects 'blob', 'document', and 'json' with a thrown Error. Only 'arraybuffer', 'text', and undefined/fallback are supported, because the SignalR client only needs binary and text payloads.","triggerScenarios":"A caller sets request.responseType to 'blob', 'document', or 'json' on an HttpRequest passed to FetchHttpClient (or to the default HttpClient.send). This is almost always user error: SignalR's transports only ever request text or arraybuffer.","commonSituations":"Custom HttpClient wrapper or a user that manually drives httpClient.get/post with responseType set for their own use. Misconfiguration copied from a generic fetch tutorial.","solutions":["Use responseType 'arraybuffer' (binary) or 'text' (JSON/JSON-protocol), or omit it to default to text.","If you genuinely need blob/json, implement a custom HttpClient rather than reusing FetchHttpClient with an unsupported responseType.","Audit any code that builds HttpRequest literals for the SignalR client and remove responseType values other than text/arraybuffer."],"exampleFix":"// before\nconst resp = await httpClient.get(url, { responseType: \"json\" });\n\n// after\nconst resp = await httpClient.get(url, { responseType: \"text\" });\nconst data = JSON.parse(resp.content as string);","handlingStrategy":"validation","validationCode":"const ALLOWED = new Set([\"arraybuffer\", \"text\", undefined]);\nfunction assertResponseType(rt?: XMLHttpRequestResponseType): void {\n  if (!ALLOWED.has(rt)) throw new Error(`Unsupported responseType: ${rt}`);\n}","typeGuard":"function isSupportedResponseType(rt: unknown): rt is \"arraybuffer\" | \"text\" | undefined {\n  return rt === undefined || rt === \"arraybuffer\" || rt === \"text\";\n}","tryCatchPattern":"try { await httpClient.get(url, { responseType }); }\ncatch (e) {\n  if (e instanceof Error && /is not supported/.test(e.message)) {\n    return httpClient.get(url, { responseType: \"text\" });\n  }\n  throw e;\n}","preventionTips":["Never set responseType to blob/document/json for SignalR requests.","Build a typed wrapper that constrains responseType to text|arraybuffer.","Document which responseType values the client supports in your wrapper."],"tags":["http","response-type","fetch","validation"],"backgroundTag":null,"analyzedSha":"3600ca084e9c8b5f4174fc5e747f4c52d2100806","analyzedAt":"2026-08-11T16:32:30.678Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}