I am new to both woocommerce and Ionic and am trying to create an application with woocommerce as backend I have implemented the get request based rest apis in project but am unable to implement the apis with the post request.the function I tried to write for post request to woocommerce create order api
is as follows.
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());
}
but this does not seems to work.
I have already referred to This tutorial This Doc This Doc but am unable to understand the issue and implement the api.it would be great if it could be explained with an example.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…