Monu Tools

cURL → fetch変換

curlコマンドを同等のJavaScript fetchコードに変換します。ブラウザ内で完結します。

cURL→fetch変換の使い方

  1. 01

    curlコマンドを貼り付けます。

  2. 02

    同等のfetchコードが即座に生成されます。

  3. 03

    JavaScriptをプロジェクトにコピーします。

Turn curl into fetch

A converter that turns a curl command into equivalent JavaScript fetch code, parsing the method, URL, headers and body so you get a ready-to-use request instead of translating it by hand.

It is a common need: API docs and tools like browser devtools give you a curl command, but your app is written in JavaScript. This bridges the two so you can paste curl and get fetch.

It runs locally in your browser, so your command, including any tokens or credentials in the headers, never leaves your device.

Flags it understands

It understands the common flags: -X for the method, -H for headers, -d and its variants for the body, -u for basic auth, plus -A for the user agent and -b for cookies. A data flag implies POST, matching how curl behaves.

Multi-line commands

Multi-line commands work as-is. Backslash line continuations are joined automatically, so you can paste a command exactly as it appears in documentation without cleaning it up first.

Ready-to-run output

The output is a fetch call with the method, headers and body filled in, which you can drop into your code and await like any other fetch.

よくある質問

どのcurlフラグに対応していますか?

一般的なフラグ:メソッド指定の-X、ヘッダーの-H、ボディのバリアント-d、Basic認証の-u、-A、-bに対応しています。データフラグはPOSTを意味します。

コマンドはサーバーに送信されますか?

いいえ。変換はブラウザ内で完結するため、コマンドとそこに含まれるトークンがデバイスの外に出ることはありません。

複数行のコマンドに対応していますか?

はい。バックスラッシュによる行の継続は自動的に結合されるため、ドキュメントに表示されるコマンドをそのまま貼り付けられます。

出典

このツールを埋め込む

このツールをご自身のウェブサイトに追加できます。下のコードをコピーしてください。内容は自動的に最新の状態に保たれます。

<iframe src="https://monu.tools/embed/ja/curl-to-fetch" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>

関連ツール