ENع
الدرس 21 · Async JavaScript

fetch: talking to servers

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

fetch(url) is how a page asks a server for data: it sends an HTTP request and hands back a promise straight away. Follow an eight-line script that loads one user, from the request and the paused await, through the response, the res.ok check and res.json(), to the printed name, and see why a 404 reply does not make fetch fail on its own.

11 دقيقة11 خطوات5 أسئلةIntermediate
شكل 21 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.