[GH-ISSUE #5728] [bug]: Failed to Import cURL with Multi-line Data and Escaped Characters #2233

Open
opened 2026-03-16 23:40:26 +03:00 by kerem · 0 comments
Owner

Originally created by @LiuZ0814 on GitHub (Dec 26, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5728

Is there an existing issue for this?

  • I have searched existing issues and this bug hasn't been reported yet

Platform

Desktop App

Browser

Chrome

Operating System

Windows

Bug Description

  1. Summary (问题简述)
    The cURL import feature fails to parse requests containing complex --data-raw payloads, especially when they include escaped newlines (\n), multi-line strings, or shell-specific syntax like $'...'.

  2. Environment (环境信息)
    Platform: Web / Desktop App

Hoppscotch Version: Latest

  1. Steps to Reproduce (重现步骤)
    Open Hoppscotch.

Click on Import -> Import from cURL.

Paste the following cURL command (Simplified version of the problematic code):

Bash

curl 'https://api.siliconflow.cn/v1/chat/completions'
-H 'accept: /'
-H 'accept-language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7'
-H 'api-key: sk-osiafwwgxvhdevctkmin'
-H 'authorization: Bearer sk-osiafwwgxvhdevctkmin'
-H 'content-type: application/json'
-b '__SF_auth.session-token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwia2lkIjoieUtkdXFTY19KZ2h0RGQwb01hclFFVWtMdWxPcEJGcnN4MDRmTzZnbElhaEZjQUxHYUoxZWlZMDlZbHZPU0VMVmk0NVg1VnVIUFFWMW1tTnJWTnpmSVEifQ..kI1SjymjJYGVK-wPDnCXCw.9xNsHbZJ31KW1tPBqg6--cljFlB5kit6n28xR_YvHKDza3y9OrIO9099RKEdkYuRym-QdW8BsTOLL3VBYO08BAGEk69O-fpK1h5unedU1EoKMxTLZyf0NgBIBrr1W6Zjy3d4l9B2DeJnV8tlboa9qXVIIdFA1tGFghf1vySS_mVT0bicUidI6JV7EJ3FfEvjCoNZvVG99MUWUubv2J_kbN3nqYXxejt41G4Xtx0oX4w.wd6c8DZ0uvXwAlDwXyp77LVhK6RCwBS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ri5nZASDa94XAd1tfTQT5Qa5F0p/3bd9RqWC3zF/faUPx_K18EcX4FvT18Dkf_xRY48kd5VFRY74XFrUGY05AhavMxQqwsmaduqQAxeaYCbkHFmDmvAADs0YGDWD=7D6HkBDhiqWenhHBKMK10DHAqi5lD7jGZG7xhPiu=iY05ienhlgK8r5lOe0sjGsGa2qWn48her4fF3YN9GSiNlqeGYiY5Dx0wYGtleWG43DD'
-H 'origin: chrome-extension://amkbmndfnliijdhojkpoglbnaaahippg'
-H 'priority: u=1, i'
-H 'sec-fetch-dest: empty'
-H 'sec-fetch-mode: cors'
-H 'sec-fetch-site: none'
-H 'sec-fetch-storage-access: active'
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0'
-H 'validtoken: sk-osiafwwgxvhdevctkmin'
--data-raw $'{\n "model": "Qwen/Qwen3-8B",\n "temperature": 0,\n "messages": [\n {\n "role": "system",\n "content": "You are a professional Simplified Chinese Language native translator specialized in GitHub content who needs to fluently translate text into Simplified Chinese Language.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content\n2. Preserve all code snippets, commands, and technical syntax exactly as in the original\n3. If the text contains HTML tags, consider where the tags should be placed in the translation while maintaining fluency\n4. Maintain all markdown formatting, including headings, lists, tables, and code blocks\n5. Keep all GitHub-specific terminology (e.g., pull request, fork, commit, repository) in its original form\n6. Preserve all URLs, file paths, and version numbers exactly as in the original\n7. Maintain the original document structure and paragraph breaks\n\n## Context Awareness\nDocument Metadata:\nTitle: 《Installation | Pyrefly》\n\n## Input-Output Format Examples\n\n### Input Example:\nParagraph A\n\n%%\n\nParagraph B\n\n%%\n\nParagraph C\n\n%%\n\nParagraph D\n\n### Output Example:\nTranslation A\n\n%%\n\nTranslation B\n\n%%\n\nTranslation C\n\n%%\n\nTranslation D"\n },\n {\n "role": "user",\n "content": "Translate to Simplified Chinese Language:\n\nConfigure\n\n%%\n\nYou can set up a basic configuration file to type-check your project. You can add configuration options to a pyproject.toml file or create a pyrefly.toml file in your project directory. All configuration options are documented here.\n\n%%\n\nThen, run pyrefly check again, and the tool will use your configuration options.\n\n%%\n\nThe tool may return a list of type errors; this is perfectly normal. You have a few options at this point: "\n }\n ],\n "think": false\n}'

  1. Expected Behavior (预期行为)
    The request should be correctly imported with the URL, Headers, and the Body correctly formatted as JSON in the "Body" tab.

  2. Actual Behavior (实际行为)
    Issue A: Nothing happens after clicking Import, or an "Invalid cURL" error is displayed.

  3. Supporting Materials (补充材料)
    The issue seems related to how the parser handles:

ANSI-C Quoting: The $ before the data string (--data-raw $'...').

Escaped Newlines: The presence of \n inside the JSON string within the cURL command.

Large Payloads: Significant delays or timeouts when the request body is large.

Deployment Type

Hoppscotch Cloud

Version

No response

Originally created by @LiuZ0814 on GitHub (Dec 26, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5728 ### Is there an existing issue for this? - [x] I have searched existing issues and this bug hasn't been reported yet ### Platform Desktop App ### Browser Chrome ### Operating System Windows ### Bug Description 1. Summary (问题简述) The cURL import feature fails to parse requests containing complex --data-raw payloads, especially when they include escaped newlines (\n), multi-line strings, or shell-specific syntax like $'...'. 2. Environment (环境信息) Platform: Web / Desktop App Hoppscotch Version: Latest 3. Steps to Reproduce (重现步骤) Open Hoppscotch. Click on Import -> Import from cURL. Paste the following cURL command (Simplified version of the problematic code): Bash curl 'https://api.siliconflow.cn/v1/chat/completions' \ -H 'accept: */*' \ -H 'accept-language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7' \ -H 'api-key: sk-osiafwwgxvhdevctkmin' \ -H 'authorization: Bearer sk-osiafwwgxvhdevctkmin' \ -H 'content-type: application/json' \ -b '__SF_auth.session-token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwia2lkIjoieUtkdXFTY19KZ2h0RGQwb01hclFFVWtMdWxPcEJGcnN4MDRmTzZnbElhaEZjQU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IG27F0lKdsQdAT3nydlUQAO8Cc=qR2G3ojSfH5VOtg0_6GT4/BkK3A3qdFywkl4na/4X3qSec80T6BPHbqA3FfF7a/Dvf9mnpGzHPgIWRP/BrfAFZGPcYyDA76Y53xpG8Dz37a/qR4eNGv_RyDBcYNIX456fcS4wXf5PwaOQirdEcDWjm4=mgG9nDB98A7RI_wAhnUfM/uWqe0AwAKqU9x7=wy/iOR3zfTi5d8gmGW0C45_BPaQ97XakRWt1FFDQeMqFi5CDjhl9hE2DhoUKKg8u0WFhfPkVRhz2pPauAhyAFB3P/nI1_u3wpvyBbEyWCbhCaki7C2FmV4vLv4nrtri5nZASDa94XAd1tfTQT5Qa5F0p/3bd9RqWC3zF/faUPx_K18EcX4FvT18Dkf_xRY48kd5VFRY74XFrUGY05AhavMxQqwsmaduqQAxeaYCbkHFmDmvAADs0YGDWD=7D6HkBDhiqWenhHBKMK10DHAqi5lD7jGZG7xhPiu=iY05ienhlgK8r5lOe0sjGsGa2qWn48her4fF3YN9GSiNlqeGYiY5Dx0wYGtleWG43DD' \ -H 'origin: chrome-extension://amkbmndfnliijdhojkpoglbnaaahippg' \ -H 'priority: u=1, i' \ -H 'sec-fetch-dest: empty' \ -H 'sec-fetch-mode: cors' \ -H 'sec-fetch-site: none' \ -H 'sec-fetch-storage-access: active' \ -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0' \ -H 'validtoken: sk-osiafwwgxvhdevctkmin' \ --data-raw $'{\n "model": "Qwen/Qwen3-8B",\n "temperature": 0,\n "messages": [\n {\n "role": "system",\n "content": "You are a professional Simplified Chinese Language native translator specialized in GitHub content who needs to fluently translate text into Simplified Chinese Language.\\n\\n## Translation Rules\\n1. Output only the translated content, without explanations or additional content\\n2. Preserve all code snippets, commands, and technical syntax exactly as in the original\\n3. If the text contains HTML tags, consider where the tags should be placed in the translation while maintaining fluency\\n4. Maintain all markdown formatting, including headings, lists, tables, and code blocks\\n5. Keep all GitHub-specific terminology (e.g., pull request, fork, commit, repository) in its original form\\n6. Preserve all URLs, file paths, and version numbers exactly as in the original\\n7. Maintain the original document structure and paragraph breaks\\n\\n## Context Awareness\\nDocument Metadata:\\nTitle: 《Installation | Pyrefly》\\n\\n## Input-Output Format Examples\\n\\n### Input Example:\\nParagraph A\\n\\n%%\\n\\nParagraph B\\n\\n%%\\n\\nParagraph C\\n\\n%%\\n\\nParagraph D\\n\\n### Output Example:\\nTranslation A\\n\\n%%\\n\\nTranslation B\\n\\n%%\\n\\nTranslation C\\n\\n%%\\n\\nTranslation D"\n },\n {\n "role": "user",\n "content": "Translate to Simplified Chinese Language:\\n\\nConfigure\\n\\n%%\\n\\nYou can set up a basic configuration file to type-check your project. You can add configuration options to a <code>pyproject.toml</code> file or create a <code>pyrefly.toml</code> file in your project directory. All <a id=2>configuration options are documented here</a>.\\n\\n%%\\n\\nThen, run <code>pyrefly check</code> again, and the tool will use your configuration options.\\n\\n%%\\n\\nThe tool may return a list of type errors; this is perfectly normal. You have a few options at this point: "\n }\n ],\n "think": false\n}' 4. Expected Behavior (预期行为) The request should be correctly imported with the URL, Headers, and the Body correctly formatted as JSON in the "Body" tab. 5. Actual Behavior (实际行为) Issue A: Nothing happens after clicking Import, or an "Invalid cURL" error is displayed. 6. Supporting Materials (补充材料) The issue seems related to how the parser handles: ANSI-C Quoting: The $ before the data string (--data-raw $'...'). Escaped Newlines: The presence of \n inside the JSON string within the cURL command. Large Payloads: Significant delays or timeouts when the request body is large. ### Deployment Type Hoppscotch Cloud ### Version _No response_
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#2233
No description provided.