Make sure you have included the below details when open an issue. Thank you.
Wordpress version, 6.3.1
WooCommerce Version 8.0.3
WooCommerce.NET 0.8.6
static string trimstr(string json)
{
return json.Trim(new char[] { '\uFEFF', '\u200B' });
}
static void Main(string[] args)
{
RestAPI rest = new RestAPI("https://XXXXXXXde/wp-json/wc/v3/", "ck_a5578e4e38dXXXXXXXX9fe8fc1719d6511", "cs_42cb95b6f7a06e421399XXXXXXXXXX3556fd1a31");
RestAPI WPrest = new RestAPI("https://mikeshp.de/wp-json/wp/v2/", "ck_a5578e4e38XXXXXXXXXXX92b99fe8fc1719d6511", "cs_42cb95b6f7a06eXXXXXXXXXXacb3556fd1a31", jsonDeserializeFilter: trimstr);
wc = new WCObject(rest, CultureInfo.GetCultureInfo("de-DE"));
wp = new WPObject(WPrest);
string a = "Amrum.jpg";
string b = @"C:\Temp\Amrum.jpg";
Media m = CreateImageAsync(a, `b).Result;`
private static async Task<Media> CreateImageAsync(string a, string b)
{
return await wp.Media.Add(a, b);
}
-Error Message
: "One or more errors occurred. (There was an error deserializing the object of type WooCommerce.NET.WordPress.v2.Media. Encountered unexpected character 'o'.)"
I get an error on add an Image via WP Rest Api
I also read your article so i add the trim function, but it doesnt work for me.
any ideas ?
Make sure you have included the below details when open an issue. Thank you.
-Error Message : "One or more errors occurred. (There was an error deserializing the object of type WooCommerce.NET.WordPress.v2.Media. Encountered unexpected character 'o'.)"
I get an error on add an Image via WP Rest Api I also read your article so i add the trim function, but it doesnt work for me. any ideas ?
Greetings