İçeriğe geç

cURL Dönüştürücü — cURL'den fetch, Python, Go, PHP'ye

cURL komutlarını JavaScript fetch, Node, Python requests, Go, PHP ve axios koduna çevirin. Method, query, header, cookie ve body'yi görün. Tarayıcıda çalışır.

Örnekler
cURL komutu

İstek

POSThttps://api.example.com/v1/orders

Query parametreleri

2
expand
items
limit
20

Header'lar

2
Content-Type
application/json
Authorization
Bearer demo_7f3a9c2e41

Cookie'ler

2
session
7d1f0c
theme
dark

Body

JSON
{
  "customer": "cus_42",
  "items": [
    {
      "sku": "KB-75",
      "qty": 1
    }
  ],
  "note": "It's a gift"
}

Seçenekler

Sıkıştırılmış (--compressed)
// Browsers drop forbidden headers (Cookie, Host, Referer…).
// For cookies, use credentials: "include" instead.

// Browser manual redirects return an opaque response; the 3xx status and body are unavailable.
const response = await fetch("https://api.example.com/v1/orders?expand=items&limit=20", {
  redirect: "manual",
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer demo_7f3a9c2e41",
    "Cookie": "session=7d1f0c; theme=dark"
  },
  body: JSON.stringify({
    "customer": "cus_42",
    "items": [
      {
        "sku": "KB-75",
        "qty": 1
      }
    ],
    "note": "It's a gift"
  })
});

console.log(response.status, await response.text());

POST · 25 satır · uyarı: 0Hiçbir şey gönderilmez

Tarayıcınızda çalışır. Komut yalnızca ayrıştırılır, asla çalıştırılmaz ve hiçbir istek yapılmaz.

Biçim kaynakları

Araç sayfasının güncellenme tarihi: