Closed lucamonaco closed 7 years ago
What about other APIs like wc.GetProducts(), are they all getting the same error or only this one?
Yes, all APIs getting the same error.
I think there is something wrong with your hosting company, can you please check with them?
I opened a ticket with my hosting provider.
But using Rested (Chrome Plugin for testing REST service) with the url used from SendHttpClientRequest the APIs work fine.
I think there is something wrong in the httpWebRequest
The Postman works fine, not sure why the httpwebrequest will fail. Can you have a look at the below post? http://www.looogo-web.com/web-design-company-blog/wordpress-error-406-not-acceptable-this-request-is-not-acceptable-powered-by-litespeed-web-server-litespeed-technologies/
Yes. Suggested tip solved the issue. Thank you Xiao Congratulatitions for yout great work.
Make sure you have included the below details when open an issue. Thank you.
Wordpress version, WooCommerce version and WooCommerce.NET version WP version: 4.7.3; WooCommerce version: 2.6.14; WooCommerce.NET version: Latest
Steps to replicate the issue string key = "ck_d4ca3dc2079655d25cac92ad5eb600347112149f"; string secret = "cs_4cab36fc9143f9b3650060e9c1ba140f5db72415"; RestAPI rest = new RestAPI("http://zr17.it/wp-json/wc/v1/", key,secret); WooCommerceNET.WooCommerce.WCObject wc = new WCObject(rest); var products = await wc.GetProductAttributes();
Details of the error message if there is any Server response in text/html
<!DOCTYPE html>\n<html style=\"height:100%\">\n<head><title> 406 Not Acceptable\r\n</title></head>\n<body style=\"color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;\">\n<div style=\"height:auto; min-height:100%; \"> <div style=\"text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;\">\n <h1 style=\"margin:0; font-size:150px; line-height:150px; font-weight:bold;\">406</h1>\n<h2 style=\"margin-top:20px;font-size: 30px;\">Not Acceptable\r\n</h2>\n<p>This request is not acceptable</p>\n</div></div><div style=\"color:#f0f0f0; font-size:12px;margin:auto;padding:0px 30px 0px 30px;position:relative;clear:both;height:100px;margin-top:-101px;background-color:#474747;border-top: 1px solid rgba(0,0,0,0.15);box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset;\">\n<br>Proudly powered by <a style=\"color:#fff;\" href=\"http://www.litespeedtech.com/error-page\">LiteSpeed Web Server</a><p>Please be advised that LiteSpeed Technologies Inc. is not a web hosting company and, as such, has no control over content found on this site.</p></div></body></html>