thedesk/app/js/common/api.js
2020-07-10 14:16:39 +09:00

17 lines
410 B
JavaScript

async function getJson(start) {
let json = {}
let response = null
response = await fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json'
}
})
if (!response.ok) {
response.text().then(function (text) {
setLog(response.url, response.status, text)
})
}
json = await response.json()
return json
}