Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let xhr = new XMLHttpRequest();
- xhr.open("POST", url, true);
- xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- xhr.onreadystatechange = () => {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- resolve(JSON.parse(xhr.responseText));
- } else {
- reject(xhr.responseText);
- }
- }
- };
- xhr.send('username=lala&password=lala');
- xhr.send('username=lala&password=lala');
Add Comment
Please, Sign In to add comment