curl कमांड को समकक्ष JavaScript fetch कोड में बदलें, पूरी तरह आपके ब्राउज़र में।
cURL to fetch का उपयोग कैसे करें
curl कमांड पेस्ट करें।
समकक्ष fetch कोड तुरंत जनरेट होता है।
JavaScript को अपने प्रोजेक्ट में कॉपी करें।
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.
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 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.
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.
अक्सर पूछे जाने वाले सवाल
सामान्य: method के लिए -X, headers के लिए -H, body के लिए -d और इसके variants, basic auth के लिए -u, साथ ही -A और -b। data flag POST का संकेत देता है।
नहीं। कनवर्शन पूरी तरह आपके ब्राउज़र में चलती है, इसलिए आपकी कमांड और इसमें कोई भी token कभी आपके डिवाइस से नहीं जाते।
हां। Backslash line continuations स्वचालित रूप से जुड़ती हैं, इसलिए आप कमांड को ठीक वैसे पेस्ट कर सकते हैं जैसे यह दस्तावेज़ में दिखाई देती है।
इस टूल को एम्बेड करें
इस टूल को अपनी वेबसाइट में जोड़ें। नीचे दिया स्निपेट कॉपी करें; यह अपने आप अपडेट रहता है।
<iframe src="https://monu.tools/embed/hi/curl-to-fetch" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>संबंधित टूल
JSON को TOML में और TOML को वापस JSON में बदलें, दोनों दिशाओं में, पूरी तरह आपके ब्राउज़र में।
HTML, CSS या JSON में एम्बेड करने के लिए छवि को Base64 data URI में बदलें, पूरी तरह आपके ब्राउज़र में।
बेस रंग से tint और shade scale साथ ही complementary, analogous और triadic रंग जनरेट करें।
किसी भी इमेज को एक पूरे favicon सेट में बदलें, जिसमें .ico, PNG साइज़, Apple touch icon और web manifest शामिल हैं, सब कुछ आपके ब्राउज़र में जेनरेट होता है।