import urllib.request, ssl
XFF="54.255.42.219"; B="http://phadmin.msjshy.com"
ctx=ssl.create_default_context(); ctx.check_hostname=False; ctx.verify_mode=ssl.CERT_NONE
def get(path, data=None, method=None, hdrs=None):
    h={"X-Forwarded-For":XFF,"User-Agent":"Mozilla/5.0"}
    if hdrs: h.update(hdrs)
    req=urllib.request.Request(B+path, headers=h, method=method)
    if data is not None: req.data=data.encode()
    try:
        r=urllib.request.urlopen(req, timeout=12, context=ctx); return r.status, r.read(), dict(r.headers)
    except urllib.error.HTTPError as e: return e.code, e.read(), dict(e.headers)
    except Exception as e: return -1, str(e).encode(), {}

# Full headers of "404 No Router"
st,body,h = get("/index.php?s=xxx")
print("=== 404 No Router full headers ===")
for k,v in h.items(): print(f"  {k}: {v}")
print("body:", body)
print()
# full doLogin response
st,body,h = get("/admin/public/doLogin", data="username=a&password=b&code=c")
print("=== doLogin full body ===")
print(body.decode('utf-8','ignore'))
