QCSunny Lab

cURL to Code ConvertercURL 转多语言代码生成器

Statistics统计数据
Output转换输出

Paste a curl command (or a browser "Copy as cURL" export) and get equivalent Python requests and JavaScript fetch code: method, URL, query parameters, headers, request body and Basic Auth are parsed and re-emitted as structured code.

The parser knows the shell-quoting games "Copy as cURL" plays (escaped quotes, line continuations, ANSI junk) and strips them at the source, so the generated code carries your data — not your terminal's quoting artifacts.

Frequently asked questions

Is my token safe here?

Yes — parsing is pure JavaScript in your browser; nothing is uploaded. (Still, prefer placeholder tokens when pasting into screenshots or issues.)

Why does the generated code use a params dict instead of the URL string?

Structured parameters are the maintainable form: the library re-encodes them correctly, and diffs stay readable when a value changes.

中文说明

粘贴 curl 命令(或浏览器的 “Copy as cURL” 导出),得到等价的 Python requests 与 JavaScript fetch 代码:方法、URL、查询参数、请求头、请求体与 Basic Auth 都被解析后以结构化代码重新输出。

解析器认识 “Copy as cURL” 玩的 shell 引号把戏(转义引号、续行符、ANSI 杂质)并在源头剥掉,生成的代码里只有你的数据、没有终端的转义残渣。

常见问题

token 会泄露吗?

不会——解析是纯浏览器端 JavaScript,不上传任何内容。(当然,往截图或 issue 里贴时仍建议用占位符。)

为什么生成的代码用参数字典而不是 URL 字符串?

结构化参数才可维护:库会正确地重新编码,值变化时 diff 也保持可读。