import asyncio, aiohttp

BASE = "http://129.153.62.97:8040"
JSON = {"email": "qa-probe@example.com", "name": "QA", "masterPasswordHash": "AAAA",
        "masterPasswordHint": None, "key": "2.aaaa", "kdf": 0, "kdfIterations": 600000}
HDRS = {"Device-Type": "10", "Bitwarden-Client-Name": "web", "Bitwarden-Client-Version": "2026.6.0"}


async def main():
    tout = aiohttp.ClientTimeout(total=15)
    async with aiohttp.ClientSession(timeout=tout, headers={"User-Agent": "Mozilla/5.0"}) as s:
        tests = [
            ("json", "POST", "/identity/accounts/register", {"json": JSON, "headers": HDRS}),
            ("json+slash", "POST", "/identity/accounts/register/", {"json": JSON, "headers": HDRS}),
            ("form", "POST", "/identity/accounts/register", {"data": JSON, "headers": HDRS}),
            ("identity-root", "GET", "/identity", {}),
            ("webfont", "GET", "/app/main.js", {}),
        ]
        for name, m, path, kw in tests:
            try:
                fn = s.post if m == "POST" else s.get
                async with fn(BASE + path, ssl=False, **kw) as r:
                    t = await r.text()
                print(f"{name:14s} {m} {path:32s} -> {r.status} ct={r.headers.get('Content-Type','')[:25]} {t[:120]!r}")
            except Exception as e:
                print(f"{name:14s} -> ERR {type(e).__name__}")

asyncio.run(main())
