cURL 转 Fetch
将 cURL 命令转换为 JavaScript fetch
🔒 100% client-side — your data never leaves this page输入
🔒 100% client-side
输出
JavaScript fetch code will appear here
About this tool
粘贴 cURL 命令后可立即转换为 JavaScript fetch 代码,自动提取请求方法、URL、请求头和请求体,帮助你从命令行调试快速过渡到前端或 Node 项目。适合 API 联调、接口文档示例生成和团队协作场景,节省重复手写请求代码时间。
Frequently Asked Questions
What cURL flags are supported?
Common flags like -X/--request, -H/--header and -d/--data are supported, including common data variants used in API calls.
Does it auto-detect HTTP method?
Yes. If method is not provided, the converter uses POST when body data exists, otherwise GET.
Is this converter safe for tokens and secrets?
Yes. Conversion runs entirely in your browser. Sensitive headers or payloads are not sent to any server.