{"record":{"id":"14f20628749d5b68","repo":"Kong/insomnia","slug":"enter-a-valid-endpoint-url","errorCode":null,"errorMessage":"Enter a valid endpoint URL","messagePattern":"Enter a valid endpoint URL","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/insomnia/src/ui/components/first-request-creation.tsx","lineNumber":72,"sourceCode":"\n    if (!importedRequest?.url) {\n      throw new Error('Invalid cURL request');\n    }\n\n    return importedRequest;\n  } catch (error) {\n    throw new Error(parseCurlImportError(error));\n  }\n};\n\nconst normalizeRequestUrl = (value: string) => {\n  const normalizedUrl = setDefaultProtocol(value.trim());\n\n  try {\n    new URL(normalizedUrl);\n    return normalizedUrl;\n  } catch {\n    throw new Error('Enter a valid endpoint URL');\n  }\n};\n\n// Collapse a multi-line cURL (backslash line-continuations and/or bare newlines,\n// with their trailing indentation) into a single line, preserving intra-line spacing.\nconst flattenCurlCommand = (value: string) =>\n  value\n    .replace(/\\\\\\r?\\n\\s*/g, ' ')\n    .replace(/\\r?\\n\\s*/g, ' ')\n    .trim();\n\n// Read the HTTP method from a cURL string, for keeping the method dropdown in\n// sync while typing/pasting/importing. Mirrors the real importer's extractMethod\n// (src/main/importers/importers/curl.ts): explicit -X/--request wins (including\n// curl's cuddled short-flag form, e.g. -XPUT); otherwise -G/--get combined with a\n// -d/--data flag moves the data into the query string instead of the body (so the\n// method stays GET); otherwise a body/form flag implies POST, otherwise GET.\n// Always resolves so the preview never goes stale relative to what the actual","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia/src/ui/components/first-request-creation.tsx#L54-L90","documentation":"Error \"Enter a valid endpoint URL\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia/src/ui/components/first-request-creation.tsx:72 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"}