Skip to content
YAS.SH
Developer🔒 المتصفح (محلي)متاح عبر API📴 يعمل بدون اتصالintermediate

محول cURL إلى Fetch و Python

يحوّل أوامر cURL إلى كود fetch في TypeScript وPython requests وGo http.

البيانات تبقى في متصفحك ولا تُرسل لأي سيرفر
جاهز للاستخدام الفوريمعالجة فورية فائقة السرعة
كل الأدوات →
النتيجة

إيه اللي الأداة دي بتعمله؟

يحوّل أوامر cURL إلى كود fetch في TypeScript وPython requests وGo http.

إمتى أستخدمها؟

  • نسخت أمراً من أدوات المطوّر وتحتاج تنفيذه في التطبيق.
  • تريد تجنب أخطاء الهيدر والجسم عند النقل اليدوي.
  • تحوّل سكربتات شِل إلى خدمات حديثة.

مثال واقعي

الإدخال
curl -X POST https://api.example.com/v1/users -H 'Content-Type: application/json' -d '{"name":"Alice"}'
الناتج
const res = await fetch('https://api.example.com/v1/users', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'Alice' }) });

يستخرج الطريقة والهيدر والرابط ويحلل جسم JSON إن أمكن.

إدخال → معالجة → ناتج → الخطوة التالية

الإدخال
الصق أمر cURL صالحاً.
المعالجة
يحلّل الأعلام (-X, -H, -d, --data-raw, -u) ويبني مقتطفات.
الناتج
كود جاهز للنسخ في ثلاث لغات.
الخطوة التالية
انقله إلى مشروعك واحذف أي أسرار ظاهرة.

أخطاء شائعة

  • ترك مفاتيح API في كود الواجهة الأمامية.
  • نسيان معالجة الأخطاء والوعود.
  • إرسال JSON دون ترويسة Content-Type.

يعني إيه النتيجة

ترجمة مباشرة لمعاملات الصدفة إلى عميل HTTP في لغة الهدف.

الخصوصية والأمان

Your input is processed entirely in your browser and never sent to a YAS server.

API

Endpoint
POST https://yas.sh/api/v1/tools/curl-to-fetch
Request Header
Content-Type: application/json
cURL
curl -X POST "https://yas.sh/api/v1/tools/curl-to-fetch" \
  -H "Content-Type: application/json" \
  -d '{"input":"curl -X POST https://api.example.com -d '{\"a\":1}'"}'
JavaScript
const res = await fetch("https://yas.sh/api/v1/tools/curl-to-fetch", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "input": "curl -X POST https://api.example.com -d '{\"a\":1}'"
}),
});
const data = await res.json();
Python
import requests

r = requests.post("https://yas.sh/api/v1/tools/curl-to-fetch", json={"input":"curl -X POST https://api.example.com -d '{\"a\":1}'"})
data = r.json()
FieldTypeRequiredDescription
inputstringYescURL command
Success response
{ "slug": "curl-to-fetch", "parsed": { "url": "https://api.example.com", "method": "POST" } }

Convert cURL command to JS Fetch, Python, and Go code.

Error responses
  • 400 VALIDATION_ERROR — invalid input or unsupported option.
  • 413 PAYLOAD_TOO_LARGE — input exceeds the 64 KB limit.
  • 429 RATE_LIMIT_EXCEEDED — rate limit exceeded (60 req/min).
Limits
  • Maximum input: 64 KB per request.
  • Rate limit: 60 requests/min per IP address.
  • Authenticated accounts benefit from higher tier quotas.
اسأل مساعد YAS
🍪 ملفات الارتباط والخصوصية. ملفات ضرورية لتسجيل الدخول واللغة والسمة. قد يستخدم Google AdSense ملفات للإعلانات بعد اختيار «قبول الكل». يعمل reCAPTCHA على صفحات تسجيل الدخول والتواصل. كيفية استخدام Google للبيانات: https://policies.google.com/technologies/partner-sites سياسة الكوكيز · سياسة الخصوصية.
الإعدادات