Rest API teszt
This commit is contained in:
15
rest/posts.js
Normal file
15
rest/posts.js
Normal file
@@ -0,0 +1,15 @@
|
||||
let keres=new XMLHttpRequest();
|
||||
let valasz="";
|
||||
|
||||
keres.open('GET','https://jsonplaceholder.typicode.com/posts',true);
|
||||
|
||||
keres.onload=function(){
|
||||
valasz=JSON.parse(this.response);
|
||||
console.log(valasz);
|
||||
}
|
||||
|
||||
keres.send();
|
||||
|
||||
console.log("Válasz:"+valasz);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user