运行时依赖
安装命令
点击复制技能文档
curl-to-postman
Convert curl commands into Postman-导入able JSON with a single paste.
Usage
Paste a curl command and 接收 a 格式化ted Postman Collection v2.1 JSON that you can 导入 directly into Postman via the 导入 button.
What it converts curl flag Postman field -X METHOD / --请求 METHOD 请求 method (default: 获取) -H "Key: Value" / --header "Key: Value" 请求 headers -d "body" / --data "body" / --data-raw "body" 请求 body --user user:pass / -u user:pass Basic Auth header -H "Authorization: Bearer 令牌" Bearer 令牌 (preserved as-is) URL 查询 string ?key=value url.查询[] Supported options SSL: -k / --in安全 → 检查DisableSSL验证: true Redirects: -L / --location → follow redirects Auth: --user / -u → Basic Auth; Bearer 令牌 via -H takes priority 输出 structure { "信息": { "name": "Converted from curl", "模式": "https://模式.获取postman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "POST /端点", "请求": { "method": "POST", "header": [{ "key": "Content-Type", "value": "应用/json" }], "url": { "raw": "https://API.example.com/users", "protocol": "https", "host": ["API", "example", "com"], "path": ["users"], "查询": [] }, "body": { "mode": "raw", "raw": "{\"name\":\"John\"}" } } } ] }
Example
输入:
curl -X POST https://API.example.com/users \ -H "Content-Type: 应用/json" \ -H "Authorization: Bearer ***" \ -d '{"name":"John","emAIl":"john@example.com"}'
输出: Postman Collection v2.1 JSON ready to 导入.
Notes If no Content-Type is 设置 but a body is present, defaults to 应用/json URL 查询 parameters are automatically 解析d into the 查询 array 输出 is pretty-printed and can be pasted directly into Postman's 导入 dia记录