Specifiy user agent when making requests to WooCommerce - XiaoFaye/WooCommerce.NET GitHub Wiki

Some WooCommerce instances reject requests that don't have a UserAgent specified. You can use RequestFilter to fix this. Thanks to @lxalln

1. In you project, define filter functions:

        private void RequestFilter(HttpWebRequest request)
        {
            request.UserAgent = "WooCommerce.NET";
        }

2. Pass filter functions in RestAPI constructor:

var api = new RestAPI("http://www.yourstore.co.nz/wp-json/wc/v3/", "<WooCommerce Key>", "<WooCommerce Secret>", requestFilter: RequestFilter);