Angular 9对讲机API,如何修复CORS错误?
我正在尝试访问内部通信API,并使用他们的API在那里创建一家公司 但是得到CORS的错误Angular 9对讲机API,如何修复CORS错误?,angular,intercom,Angular,Intercom,我正在尝试访问内部通信API,并使用他们的API在那里创建一家公司 但是得到CORS的错误 URL = 'https://api.intercom.io/companies' this.httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': 'Bearer ....', 'Access-Control-Allow-
URL = 'https://api.intercom.io/companies'
this.httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
'Authorization': 'Bearer ....',
'Access-Control-Allow-Origin': '*'
})
};
const path = this.URL + '/companies';
return this.http.post(path, data, {headers: this.httpOptions});
如何修复CORS错误?内部通信API在客户端不起作用。 您需要使用服务器端包在对讲机上进行api调用 您可以使用其中之一: 1-Nodejs http客户端包:
axios
2-正式节点包:内部通信节点