angular6 - 我无法从 Scopus 获得回复 API

angular6 - I can't get response from Scopus API

我想使用 Scopus API 来验证 DOI 是否存在。我正在使用“Cited By" option. I did a test of this "http://api.elsevier.com/content/search/scopus?query=DOI(10.1016/j.stem.2011.10.002)" link in POSTMAN and it works, but when I did the implementation in Angular this is what returns.

Angular代码

let headers = new Headers({ 
            'X-ELS-APIKey': apikey,
            'Accept': 'application/json',
        });
        this._http.get('http://api.elsevier.com/content/search/scopus?query=DOI(' + doi + ')', { headers: headers }).pipe(map(res => res.json())).subscribe(
            response => {
                console.log("Response");
                console.log(response);
            },
            error => {
                console.log("Error");
                console.log(error);
            }
        );

非常感谢任何帮助:)

终于解决了,问题是"doi"字符串需要经过encodeURIComponent()函数。我留下代码以防有人需要它。

welcome.component.ts:

let doi = encodeURIComponent('10.1017/j.stem.2011.10.002');
this._scopusService.getPublication(doi).subscribe(
    response => {
    console.log("DOI exists");
},
error => {
    console.log("DOI doesn't exists");
}

scopus.service.ts:

public getPublication(doi) {
    let headers = new Headers({
        'Accept': 'application/json',
        'X-ELS-APIKey': this.apiKey
    });

    return this._http.get('https://api.elsevier.com/content/search/scopus?query=DOI(' + doi + ')', { headers: headers }).pipe(map(res => res.json()));
}