Rest API teszt

This commit is contained in:
Kovács Rudolf
2026-10-21 11:16:53 +02:00
parent f2c32b0c9b
commit b4e90847af
3 changed files with 52 additions and 0 deletions

15
rest/posts.js Normal file
View 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);