Skip to content

Instantly share code, notes, and snippets.

@vczb
Created October 3, 2024 17:57
Show Gist options
  • Save vczb/0bd8aaca3b628857d6bc6e7180827c92 to your computer and use it in GitHub Desktop.
Save vczb/0bd8aaca3b628857d6bc6e7180827c92 to your computer and use it in GitHub Desktop.
override-post-requests
//https://stackoverflow.com/questions/69592467/override-post-requests
let send = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.send = function (body) {
const newBody = JSON.parse(body);
newBody.id = 304622;
send.call(this, JSON.stringify(newBody));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment