Topic: Call Wialon Remote API from angular http client
Hi, i want to call wialon remote API from angular http client, but i get the error "from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."
this is my code
export class WialonAPIService {
rooturl = 'https://hst-api.wialon.com/wialon/ajax.html?svc=';
urlGetUnits = 'core/search_items¶ms=' +
'{"spec":{"itemsType":"avl_unit","propName":"sys_name","propValueMask":"*","sortType":"sys_name"},' +
'"force":1,"flags":1,"from":0,"to":0}&sid=0961c9cd63b4f328d32fe64760aae515';
constructor(private http: HttpClient) { }
getUnits() {
console.log('get truck wialon');
return this.http.get(this.rooturl + this.urlGetUnits)
.pipe(map(res => res));
}
}
It is necesary to call ir directly from the backend or i can call ir directly from my angular app?