woocommerce / wc-api-ruby

A Ruby wrapper for the WooCommerce API.
MIT License
69 stars 73 forks source link

400 bad request #42

Closed ikosalander closed 5 years ago

ikosalander commented 6 years ago

hi guys, i have some troubles with this gem, it return error 400, sometimes 401 and 403. someone have this little piece of code who work ? or know where is my error ?

require "woocommerce_api"

api = WooCommerce::API.new(
  "https://xxx.co",
  "ck_",
  "cs_",

  {
    version: "v3",
  }
)

p api.get("").parsed_response

thanks guys i give roses for my hero

claudiosanches commented 5 years ago

Responses comes from the server you are making the requests. Sometimes your server have something blocking or just doing bad requests. But doesn't sounds like an issue with this library, even more because you are using HTTPS and there's no need to build a oAuth1.0a request, so sounds like it's something in your server, try check the access log and error log for the requests, also check if is getting blocked by mod_Security or something like, even CloudFlare could influence. I hope you can solve it.