This commit is contained in:
@@ -14,6 +14,16 @@ export default class Api {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
async getAsset(sAssetPath) {
|
||||
const oRequest = await fetch(sAssetPath, {headers: {'Accept': 'application/geo+json'}});
|
||||
|
||||
if(!oRequest.ok) {
|
||||
throw new Error('Error HTTP ' + oRequest.status + ': ' + oRequest.statusText);
|
||||
}
|
||||
|
||||
return oRequest.json();
|
||||
}
|
||||
|
||||
async post(sAction, asParams = {}) {
|
||||
const response = await this.request(sAction, asParams, 'POST');
|
||||
return response.data;
|
||||
|
||||
Reference in New Issue
Block a user