【发布时间】:2018-02-04 07:11:31
【问题描述】:
我是 woocommerce 和 Ionic 的新手,我正在尝试创建一个使用 woocommerce 作为后端的应用程序写给woocommerce create order api的post请求如下。
postOrder(postparams){
var headers = new Headers();
headers.append("Accept", 'application/json');
headers.append('Content-Type', 'application/json' );
headers.append('consumer_key', 'the key comes here');
headers.append('consumer_secret', 'the secret comes here');
let options = new RequestOptions({ headers: headers });
return this.http.post(this.wc_api_path,postparams,options).map(res => res.json());
}
但这似乎不起作用。
我已经提到了This tutorialThis DocThis Doc,但是我无法理解这个问题并实现了这个api。如果能用一个例子来解释就好了。
【问题讨论】:
-
你得到了什么? API 出现任何错误或无法调用 API?
-
无法调用api。
标签: angular api woocommerce ionic2 ionic3