Use X HTTP MethodOverride header for DELETE PUT - XiaoFaye/WooCommerce.NET GitHub Wiki
Some Wordpress instances do not support DELETE/PUT verbs, so the suggested fallback is to use the X-HTTP-MethodOverride header and send a POST verb instead. You can use RequestFilter to achieve this. Thanks to @lxalln
1. In you project, define filter functions:
private void RequestFilter(HttpWebRequest request)
{
if (request.Method == RequestMethod.DELETE || request.Method == RequestMethod.PUT)
{
request.Headers.Add("X-HTTP-Method-Override", request.Method);
request.Method = "POST";
}
}
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);