CURL CONVERTER

cURL converter, paste and convert.

Paste a curl command copied from your terminal and get Python (requests), JavaScript (fetch), Go or Java request code instantly. Everything runs locally in your browser.

Paste a curl command first.

Most tools process data locally; see this page for details

How do I use the cURL converter?

Paste a curl command on the left (copy it from your browser DevTools “Copy as cURL” or Postman “Copy as cURL”). The tool detects the method, URL, headers, body and auth, then generates runnable code. Switch the language to see each version. Common flags like -X/-H/-d/-u/-G/-F are supported.

FAQ

Where do I copy a cURL command from?

Three common sources: ① in Chrome/Edge DevTools, open the Network panel, right-click a request → Copy → Copy as cURL; ② in Postman, use the Generate Code option on the request; ③ in Postman, switch the Code dropdown to cURL. The Windows version is usually double-quoted, and the converter handles that quoting difference for you.

Why does the generated code fail to run?

Authentication is the usual culprit: curl's -u "user:pass" turns into plaintext credentials, and some services also need extra headers or cookies. Another frequent cause is certificate flags — -k in curl implies verification is skipped, while Python requests verifies by default, so a self-signed endpoint needs verify=False passed explicitly.

Which flags are supported?

Including -X/--request, -H/--header, -d/--data, -u for auth, -G to move data into query parameters, -F for file uploads, -b for cookies, -x for a proxy, -L to follow redirects, --compressed and common switches. Anything unrecognised is preserved as a code comment rather than being silently dropped.

示例与注意事项Example & notes

一个例子A worked example

把浏览器「Copy as cURL」得到的一整段命令粘进来,立刻得到等价的 Python requests 与 Go 代码,连请求头和 body 都补齐。Paste a whole "Copy as cURL" command and get equivalent Python requests and Go code, headers and body included.

注意事项Things to watch

相关问答More Q&A

支持哪些目标语言?Which target languages are supported?

Python requests、JavaScript(fetch/axios)、Go、Java、PHP、Node 等常见写法,生成后可直接复制进项目。Python requests, JavaScript (fetch/axios), Go, Java, PHP and Node — ready to copy into your project.

会真的请求这个地址吗?Will it actually call that URL?

不会。只做文本解析与代码生成,不会发出任何网络请求,内网地址也能安全粘贴。No. It only parses text and writes code, so even internal hostnames are safe to paste.

Further reading

觉得好用?Found it useful?