WooCommerce.NET icon indicating copy to clipboard operation
WooCommerce.NET copied to clipboard

Customer.Get("email address") returns {"code":"rest_no_route","message":"No route was found matching the URL and request method.","data":{"status":404}}

Open fengfranklu opened this issue 4 years ago • 2 comments

Make sure you have included the below details when open an issue. Thank you.

  • Wordpress version: 5.81, WooCommerce version : 5.71 and WooCommerce.NET version 0.8.3

         RestAPI rest = new RestAPI(
                                                        "https://example.com/wp-json/wc/v3/",
                                                        "key",
                                                         "secret"
                                    );
    
          WCObject wc = new WCObject(rest);
          Customer customer = await wc.Customer.Get("[email protected]");     <-- error here. 
          Console.WriteLine(customer.email);
    
  • Details of the error message:

  • {"code":"rest_no_route",

  • "message":"No route was found matching the URL and request method.",

  • "data":{"status":404}}

is this method still valid or I did something wrong. Thanks!!!

fengfranklu avatar Oct 12 '21 02:10 fengfranklu

hi

passes URLEncoded text for email use HttpUtility.UrlEncode

encode you'r text before : https://meyerweb.com/eric/tools/dencoder

but it is better than use HttpUtility.UrlEncode on nuget

novinp avatar Oct 14 '21 11:10 novinp

I might be able to improve this in next version.

XiaoFaye avatar Nov 20 '21 01:11 XiaoFaye