{"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/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/SignalR/clients/ts/signalr/src/FetchHttpClient.ts#L160-L186","documentation":"Thrown by deserializeContent() when the request.responseType is one of 'blob', 'document', or 'json'. SignalR's HTTP client only supports reading the response as 'arraybuffer' or 'text'; the other XMLHttpRequestResponseType values are explicitly rejected because SignalR does not use them. The message interpolates the offending responseType string.","triggerScenarios":"Building an HttpRequest with responseType: 'json' or 'blob' and sending it through the HttpClient; a custom caller that sets responseType expecting automatic JSON parsing.","commonSituations":"A developer assumes responseType:'json' will auto-parse (it won't — SignalR uses text and parses internally for JSON protocol); leftover config from a generic XHR/fetch wrapper; migrating code that used XHR responseType:'blob' for downloads.","solutions":["Set responseType to 'arraybuffer' for binary (MessagePack) protocol or 'text' for JSON protocol, or omit it (defaults to text).","If you need JSON, request 'text' and call JSON.parse on the content yourself.","Audit any code that sets responseType and remove 'blob'/'document'/'json'.","When using HubConnectionBuilder you never set responseType directly — only custom HttpClient callers hit this."],"exampleFix":"// before\nawait httpClient.send({ method: 'GET', url, responseType: 'json' });\n// 'json is not supported.'\n\n// after\nconst resp = await httpClient.send({ method: 'GET', url, responseType: 'text' });\nconst data = JSON.parse(resp.content as string);","handlingStrategy":"validation","validationCode":"const ALLOWED: XMLHttpRequestResponseType[] = ['', 'text', 'arraybuffer'];\nfunction assertResponseType(rt?: XMLHttpRequestResponseType) {\n  if (rt && !ALLOWED.includes(rt)) {\n    throw new Error(`responseType '${rt}' is not supported by SignalR; use 'text' or 'arraybuffer'`);\n  }\n}\nassertResponseType(request.responseType);\nawait httpClient.send(request);","typeGuard":"const SUPPORTED = new Set<XMLHttpRequestResponseType>(['', 'text', 'arraybuffer']);\nfunction isSupportedResponseType(rt: unknown): rt is XMLHttpRequestResponseType {\n  return typeof rt === 'string' && SUPPORTED.has(rt as XMLHttpRequestResponseType);\n}","tryCatchPattern":"try {\n  await httpClient.send(request);\n} catch (e) {\n  if (/is not supported/.test(e.message)) {\n    request.responseType = 'text'; // downgrade and retry\n    await httpClient.send(request);\n  } else throw e;\n}","preventionTips":["Only set responseType to 'text' or 'arraybuffer'; omit it to default to text.","If you need JSON, request 'text' and JSON.parse the content yourself.","Audit request-building code for stale 'blob'/'json'/'document' values."],"tags":["http-client","validation","response-type","fetch","configuration"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}