Swift Code Help Me To debug Code http response
"أريد كود بلغة Swift يقوم بإرسال طلب HTTP POST (أو GET) إلى رابط API الخاص بـ PUBG Mobile (مثال: للتحقق من بيانات اللاعب عبر الـ Character ID أو تسجيل الدخول). أريد من الكود أن:يستخدم مكتبة URLSession الأساسية في Swift.يقوم بإرسال الـ Headers المطلوبة (مثل Content-Type و Authorization إن وجدت).يستقبل الـ HTTP Response Code (مثل 200 OK، 400 Bad Request، 404 Not Found).يطبع الـ Response Code في الـ Console، وإذا كانت الاستجابة ناجحة (200)، يقوم بعمل Parsing لبيانات الـ JSON المستلمة."
Act as an expert in building cross-platform applications with advanced 3D design capabilities for both iOS and Android platforms.
Picks the correct HTTP status code for an API response from a plain description of what happened (created, validation failed, not found, conflict, rate limited, upstream down) and explains why, with common mistakes to avoid. Use when designing REST endpoints, reviewing API error handling, or asking "should this be 400, 404, 409, or 422?". Includes a stdlib Python suggester.