我正在对一个旧的 Flash 游戏进行逆向工程,并在登录过程中将 POST 请求发送到服务器。动作脚本2:
req.username = inicial.login_mc.username_txt.text;
req.password = inicial.login_mc.password_txt.text;
xmlResponse = new LoadVars();
xmlResponse.onLoad = function() {
xml = new XML(xmlResponse.xml);
trace("login xml: " + xml);
user = xml.childNodes[0];
};
url_login = "api/auth/user";
req.sendAndLoad(url_login, xmlResponse, "POST");
Run Code Online (Sandbox Code Playgroud)
要求:
req.username = inicial.login_mc.username_txt.text;
req.password = inicial.login_mc.password_txt.text;
xmlResponse = new LoadVars();
xmlResponse.onLoad = function() {
xml = new XML(xmlResponse.xml);
trace("login xml: " + xml);
user = xml.childNodes[0];
};
url_login = "api/auth/user";
req.sendAndLoad(url_login, xmlResponse, "POST");
Run Code Online (Sandbox Code Playgroud)
我的回复:
Request URL: http://localhost:3000/api/auth/user
Request Method: POST
Status Code: 200 OK
Remote Address: [::1]:3000
Referrer Policy: no-referrer-when-downgrade
username: aaaa
password: aaaa
Run Code Online (Sandbox Code Playgroud)
问题:Flash 没有得到任何响应,并且 xml 始终为空。flashlog.txt:
Connection: keep-alive
Content-Length: 58
Content-Type: application/xml; charset=utf-8
Date: Sun, 18 Mar 2018 20:19:50 GMT
ETag: W/"3a-G4M/BpWRvMgDdvlmOtNMapl/lLw"
X-Powered-By: Express
<response hello="world"><hi>howdoing</hi></response>
Run Code Online (Sandbox Code Playgroud)
Content-Type: text/xml 也不起作用。
可能是什么?
这可能对你有帮助
var my_xml = new XML();
var myLoginReply_xml = new XML();
myLoginReply_xml.ignoreWhite = true;
myLoginReply_xml.onLoad = function(success){
if (success) {
// xml response with success
} else {
// failure
}
};
my_xml.sendAndLoad("YOUR_URL", myLoginReply_xml);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
567 次 |
| 最近记录: |