{"record":{"id":"c8a643b220fd7465","repo":"Kong/insomnia","slug":"no-header-with-name-name-choices-are-he","errorCode":null,"errorMessage":"No header with name \"${name}\".\nChoices are [\n\t${headerNamesStr}\n]","messagePattern":"No header with name \"(.+?)\"\\.\nChoices are \\[\n\t(.+?)\n\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/insomnia/src/common/templating/local-template-tags.ts","lineNumber":971,"sourceCode":"            throw new Error('No header specified');\n          }\n\n          const headerNames: string[] = [];\n\n          if (request.headers.length === 0) {\n            throw new Error('No headers available');\n          }\n\n          for (const header of request.headers) {\n            const headerName = await context.util.render(header.name);\n            headerName && headerNames.push(headerName);\n            if (headerName?.toLowerCase() === name.toLowerCase()) {\n              return context.util.render(header.value);\n            }\n          }\n\n          const headerNamesStr = headerNames.map(n => `\"${n}\"`).join(',\\n\\t');\n          throw new Error(`No header with name \"${name}\".\\nChoices are [\\n\\t${headerNamesStr}\\n]`);\n        }\n        if (attribute === 'oauth2' || attribute === 'oauth2-identity' || attribute === 'oauth2-refresh') {\n          const access = await context.util.models.oAuth2Token.getByRequestId(request._id);\n          if (!access || !access.accessToken) {\n            throw new Error('No OAuth 2.0 access tokens found for request');\n          }\n          if (attribute === 'oauth2') {\n            return access.accessToken;\n          }\n          if (attribute === 'oauth2-identity') {\n            return access.identityToken;\n          }\n          if (attribute === 'oauth2-refresh') {\n            return access.refreshToken;\n          }\n        }\n        if (attribute === 'name') {\n          return request.name;","sourceCodeStart":953,"sourceCodeEnd":989,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia/src/common/templating/local-template-tags.ts#L953-L989","documentation":"Error \"No header with name \"${name}\".\nChoices are [\n\t${headerNamesStr}\n]\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia/src/common/templating/local-template-tags.ts:971 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}