広告が嫌いですか? 行く 広告なし 今日

cURL Command to Code Converter

開発者ネットワーキング文章

ガイド

cURL Command to Code Converter

cURL to Code Converter

Paste a curl command and instantly get the equivalent HTTP-client code in Python, JavaScript, PHP, Go, or Ruby. The converter runs entirely in your browser, parses curl with a real shell-aware tokenizer, and maps the flags you actually use — headers, JSON and form bodies, multipart uploads, basic auth, cookies, redirects, proxies, and timeouts — to idiomatic code for each target.

Unlike asking a chat assistant, the output is deterministic. The same curl command always produces the same code, with no hallucinated headers, wrong flag mappings, or invented library calls. Unsupported flags are surfaced as inline notices instead of silently dropped, so you can see exactly what the generated code does and does not cover.

使用方法

  1. Paste the full curl command into the input box (line continuations with \ are fine).
  2. Pick a target language from the dropdown — Python (requests), JavaScript (fetch or axios), Node.js (node-fetch), PHP (Guzzle or curl extension), Go (net/http), or Ruby (Net::HTTP).
  3. The code regenerates as you type. Use the copy button to grab it, or download to a file with the matching extension.
  4. If any flags could not be mapped exactly, you will see a notice listing them so nothing is lost silently.

機能

  • Eight output targets — Python requests, fetch, axios, node-fetch, Guzzle, php-curl, Go net/http, and Ruby Net::HTTP, all with idiomatic style.
  • Shell-aware parser — handles single and double quoting, backslash escapes, line continuations, combined short flags like -sLkと、 --flag=value syntax.
  • Body smart-detection — JSON payloads become typed object literals, urlencoded bodies become key/value maps, and multipart -F uploads become FormData or multipart parts.
  • Auth and cookies-u user:pass, Bearer tokens, and -b name=value cookies all land in the right place for the target language.
  • Transport flags-L, -k, --compressed, -x proxy, --connect-timeout, --max-time, and HTTP version selectors are preserved.
  • Privacy by default — the curl command never leaves your browser. Useful when you are working with API tokens you do not want to paste into a chat service.

よくある質問

  1. What does the cURL command-line tool actually do?

    cURL is a command-line client for transferring data over network protocols. It builds an HTTP (or FTP, SMTP, and other) request from command-line flags, sends it, and prints the response. The flags map directly to HTTP concepts — method, headers, body, authentication, redirects, TLS settings — which is why curl commands are commonly used as a portable, language-neutral way to describe an HTTP request in documentation and bug reports.

  2. Why are HTTP requests in different languages structured so differently?

    Each HTTP client library wraps the same wire-level request in the idioms of its host language. Python’s requests treats the request as a function call with keyword arguments. axios and fetch treat it as a config object passed to a function returning a promise. Go composes a Request struct, attaches headers, and runs it through a Client. The underlying HTTP bytes on the wire are identical — only the call sites differ. A converter translates one surface syntax to another while keeping that wire payload the same.

  3. What is the difference between application/json and application/x-www-form-urlencoded bodies?

    Both are common ways to send a request body, but they encode data very differently. application/x-www-form-urlencoded encodes the body as URL-style key=value pairs joined by ampersands, the same format used in a query string. application/json sends a JSON document and supports nested objects, arrays, and typed values like numbers and booleans. Servers parse the body based on the Content-Type header, so picking the right type is what makes the data readable on the receiving side.

  4. Why does curl not follow redirects by default, and other HTTP clients do?

    Following redirects automatically can mask bugs and create security risks — a 3xx response may redirect to a different host that should not receive the original Authorization header, for example. curl chose a conservative default that requires you to opt in with -L. Many high-level client libraries (Python requests, axios, fetch) optimize for the common case and follow redirects by default. When converting a curl command, this difference matters: code generated from a plain curl call typically needs an explicit option to disable redirect-following so that the client matches curl’s behavior.

広告なしで楽しみたいですか? 今すぐ広告なしで

拡張機能をインストールする

お気に入りのブラウザにIOツールを追加して、すぐにアクセスし、検索を高速化します。

に追加 Chrome拡張機能 に追加 エッジ拡張 に追加 Firefox 拡張機能 に追加 Opera 拡張機能

スコアボードが到着しました!

スコアボード ゲームを追跡する楽しい方法です。すべてのデータはブラウザに保存されます。さらに多くの機能がまもなく登場します!

ニュースコーナー 技術ハイライト付き

参加する

価値ある無料ツールの提供を継続するためにご協力ください

コーヒーを買って