报错如下:
代码:
list(criteria: RecommendModel) {
return this.http.post('http://music.163.com/weapi/personalized/newsong',
criteria,
{
/* headers: this.headers*/
headers: new HttpHeaders({
'Accept': '*/*',
'Accept-Language': 'zh-CN,zh;q=0.8,gl;q=0.6,zh-TW;q=0.4',
'Content-Type': 'application/x-www-form-urlencoded'
})
})
.toPromise()
.then((data: any) => {
return data;
})
.catch((err) => {
console.log(err);
});
}
除了设置headers ,还需要处理其他吗?
接口是来自:
https://binaryify.github.io/N...
这个肯定访问不了的,服务端不允许