问题
Iam working cart apllication. I installed WooCommerce plugin and generated keys in http server. But it is not returning any products data. Is WooCommerce works in HTTP or it works only in https?
回答1:
The API works on both http and https protocols. For http you'll have to encode your requests and for https since its already encoded, you just pass the key and secret as parameters. Its best if you first test the response in POSTMAN. I'm attaching screenshot of a successful get response on HTTP.
As you see, you need a Signature method, timestamp and nonce. Every server side language will have different implementations. So read the documentation and try out the examples.
Its a lot simpler for https, and I highly recommend installing an SSL certificate before going into production.
来源:https://stackoverflow.com/questions/48662665/enable-woocommerce-on-http