XiaoFaye / WooCommerce.NET

A .NET Wrapper for WooCommerce/WordPress REST API
MIT License
393 stars 218 forks source link

wrong webResponse throw 403 forbiden #660

Closed novinp closed 2 years ago

novinp commented 3 years ago

hi when i call GetAll orders to receive last 10 orders per_page=10 order=desc *orderby=date

receive 403-forbiden test with same parameteres on postman=>worked

my problem has been solved by add this line :

if (string.IsNullOrEmpty(httpWebRequest.UserAgent)) httpWebRequest.UserAgent = "my app name"; WebResponse wr = await httpWebRequest.GetResponseAsync().ConfigureAwait(false);

XiaoFaye commented 2 years ago

This could help: https://github.com/XiaoFaye/WooCommerce.NET/wiki/Specifiy-user-agent-when-making-requests-to-WooCommerce