我有wordpress和woocommerce for REST API,wordpress是在docker上运行的。对于http客户端,我使用Guzzle6和Laravel app中的Oauth库来完成请求。当我将base_url设置为localhost:port I got 401 response时,laravel应用程序在nginx后面运行
{
"code":"woocommerce_rest_authentication_error",
"message":"Invalid signature - provided signature does not match.
}当我将base_url设置为我的public ip时,它成功了。当我在我的本地机器上成功地使用本地主机作为base_url进行开发时,为什么会发生这种情况?
发布于 2019-02-17 04:36:12
我用本地主机上的postman发送一个简单的GET请求时,WooCommerce也遇到了同样的问题。我通过将WP_HOME和WP_SITEURL设置为我的本地ip地址来修复它,或者转到Admin Panel > Settings > General并将localhost替换为您的WordPress Address (URL)和Site Address (URL)的ip地址,如下所述:https://wordpress.stackexchange.com/questions/180207/how-to-make-other-computer-in-local-network-see-my-theme
希望这能有所帮助。
https://stackoverflow.com/questions/52452498
复制相似问题