【问题标题】:Woocommerce rest api authenticationWoocommerce REST API 身份验证
【发布时间】:2019-03-31 03:48:36
【问题描述】:

我启用 woocommerce rest api 并生成 consumer_key 和 consumer_secret 并在 https 下使用基本身份验证。但我得到 401(未经授权)状态码。 如何授权?

提前致谢!

【问题讨论】:

    标签: wordpress woocommerce


    【解决方案1】:

    Woocommerce rest api 使用 oAuth 1.0 所以你必须通过这些授权才能使用 woocommerce rest api

    例如:

    your endpoint : https://example.com/wc-api/v3/products
    
    method : get
    
    Authorization : oauth 1.o
    
    consumer key : your_consumer_key
    consumer secret : your_consumer_secret
    
    then try to get data in postman using `oauth 1.0`
    
    hope this will help
    

    【讨论】:

    • 我尝试了 oath 方法和 basic auth 方法,但我得到了相同的结果。 401 状态!
    • 你会分享带有api设置的后端截图
    • 所以我可以进一步帮助你
    • 如何在 Angular 中做同样的事情
    猜你喜欢
    • 1970-01-01
    • 2016-09-07
    • 1970-01-01
    • 2017-04-09
    • 1970-01-01
    • 1970-01-01
    • 2017-12-15
    • 2018-07-26
    • 2019-08-17
    相关资源
    最近更新 更多