0
我试图发送参数使用张贴请求,但参数未达到提供所需的结果,并在控制台中打印为空。这里是我的代码请求的参数不通过API发送离子2
var headers = new Headers();
headers.append('Content-Type', 'application/x-www-form-urlencoded');
let options = new RequestOptions({ headers: headers });
let postParams = {
acesscode: 'XXXXXXXXXXX',
productCode:'XXXXXXXXXX'
};
this.http.post("http://www.ebiebook.com/drmapi/v1/details", JSON.stringify(postParams), options)
.subscribe(data => {
console.log(data['_body']);
}, error => {
console.log(error);// Error getting the data
});
}
和输出画面连接,它显示API是打很好,但参数数据无法到达提供相应的结果。请建议。