import urllib.request import urllib.error import urllib.parse def test_user_info_req(): url = "https://qple-api-prod.qpleapp.com/Login/UserInfoReq" # Empty Thrift payload or simple struct (this might still 500 if the struct isn't perfect, but we'll try) # The user noted Content-Length was 169. # We will just try an empty body or simple byte sequence for now to see if we get a Thrift response or 500 data = b'\x00' * 169 req = urllib.request.Request(url, data=data, method="POST") req.add_header('Accept', '*/*') req.add_header('AppVersion', '1.5.1') req.add_header('Authorization', 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyYW5kTnVtYmVyIjoxNDA1MzU0OTgzLCJ1c2VyR1VJRCI6IjY1NTU1OTdkYWU2Mjk0ZGU3NTMwNTRjMiIsImFjY291bnRJZCI6IjEwMTMwMjUiLCJkZXZpY2VJRCI6IjU2Y2E1ZTcxZTVkOTlhZmRkMTdkYzQyZGFjNjNjMDU1IiwiZXhwaXJlc19kYXRlIjotODU4NDE5MzcyNzYzOTEyMTA3OX0.mD2vhhSYn-M4Oth_EoVhVjC4Fdn8fIIY9zhnAtkXgZ4') req.add_header('Content-Type', 'application/x-thrift') req.add_header('Cookie', 'CHARCTER_INFO=nickname=ëì¬ì¹´&branchName=ITìì¤íë¶') req.add_header('User-Agent', 'UnityPlayer/2022.3.62f2 (UnityWebRequest/1.0, libcurl/8.10.1-DEV)') req.add_header('X-Unity-Version', '2022.3.62f2') try: with urllib.request.urlopen(req, timeout=10) as response: print(f"Status: {response.status}") print(response.read()) except urllib.error.HTTPError as e: print(f"HTTP {e.code}") print(e.read()[:500]) test_user_info_req()