delfi/ui/src/utils/request.js

17 lines
331 B
JavaScript

/**
* http get request
*
* @param pth path
*/
export async function get(pth) {
const data = await fetch(pth, {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
});
const jsonData = await data.json();
return jsonData;
}