我是woocommerce和Ionic的新手,我正在尝试创建一个带有woocommerce的应用程序作为后端我已经在项目中实现了基于get请求的rest apis但是我无法使用post request实现apis.我试图为post发布的函数请求woocommerce创建订单api如下.
@H_403_8@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 tutorial This Doc This Doc但我无法理解这个问题并实现api.it如果可以用一个例子来解释它会很棒.