SimStadtApi_stud.js 605 Bytes
Newer Older
Patrick's avatar
Patrick committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function simstadtget(){


const userAction = async () => {
    var myBody = {
        "cityGMLRef": "campus",
         "interestedAttributes": [
         "buildingFunction",
         "yearOfConstruction",
         "usageType"
         ]
        }
        
    const response = await fetch('https://simstadt.wiomoc.de/dev/', {
      method: 'POST',
      body: myBody, // string or object
      headers: {
        'Content-Type': 'application/json'
      }
    });
    const myJson = await response.json(); //extract JSON from the http response
    console.log(myJson)
    // do something with myJson
  }
}