【发布时间】:2021-10-26 01:28:54
【问题描述】:
我将这段代码放在控制台中:
XMLHttpRequest.prototype.send = function(body) {
// modifies inputted request
newBody = JSON.parse(body);
newBody.points = 417;
// sends modified request
this.realSend(JSON.stringify(newBody));
}
应该是每次发送请求都会打分417,但是当我查看请求正文时,它仍然是原来的积分数量。有什么帮助吗?
【问题讨论】:
-
这部分看起来不错
-
您在哪里看到您发送的请求?你是如何保存原来的
XMLHttpRequest.prototype.send的,你以后显然会在this.realSend(...)中使用它?
标签: javascript http xmlhttprequest http-post