-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathback.js
21 lines (19 loc) · 782 Bytes
/
back.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function Login(){
const xhr = new XMLHttpRequest();
const url = "https://github.com/login/oauth/authorize?scope=user:email&client_id=Iv1.622a1872fb940cbf"
// xhr.open("GET", );
// xhr.setRequestHeader("Access-Control-Allow-Origin", "*");
// xhr.setRequestHeader("Access-Control-Allow-Headers", "X-Requested-With");
fetch(url, { method: 'GET', headers: { 'Accept': 'application/json', }, })
.then(response => response.text()) .then(text => console.log(text))
// xhr.send();
// xhr.responseType = "json";
// xhr.onload = () => {
// if (xhr.readyState == 4 && xhr.status == 200) {
// const data = xhr.response;
// console.log(data);
// } else {
// console.log(`Error: ${xhr.status}`);
// }
// };
}