WooCommerce.NET
WooCommerce.NET copied to clipboard
Media.Add error
Wordpress version 5.4.1 WooCommerce version 4.0.1 WooCommerce.NET version 0.8.2
.htaccess: RewriteCond %{HTTP:Authorization} ^(.) RewriteRule ^(.) - [E=HTTP_AUTHORIZATION:%1]
My code:
RestAPI restwp = new RestAPI("https://test.com/wp-json", "user", "pass"); WooCommerce.NET.WordPress.v2.WPObject wp = new WooCommerce.NET.WordPress.v2.WPObject(restwp); await wp.Media.Add("logo", @"C:\logo.jpg");
Media.Add returns error "There was an error deserializing the object of type WooCommerce.NET.WordPress.v2.Media. Encountered unexpected character 'o'."
Please help
I finally got Media.Add working, but now I can not work with Woocommerce api it gives error "{"code":"jwt_auth_bad_auth_header","message":"Authorization header malformed.","data":{"status":403}}"
Anyone?
I had this second error with malformed, and doing this fixed it: https://wordpress.org/support/topic/error-with-authorization-header-malformed/
Going to plugin editor for JWT plugin and commenting the lines the last comment says to
Wordpress version 5.4.1 WooCommerce version 4.0.1 WooCommerce.NET version 0.8.2
.htaccess: RewriteCond %{HTTP:Authorization} ^(.) RewriteRule ^(.) - [E=HTTP_AUTHORIZATION:%1]
My code:
RestAPI restwp = new RestAPI("https://test.com/wp-json", "user", "pass"); WooCommerce.NET.WordPress.v2.WPObject wp = new WooCommerce.NET.WordPress.v2.WPObject(restwp); await wp.Media.Add("logo", @"C:\logo.jpg");
Media.Add returns error "There was an error deserializing the object of type WooCommerce.NET.WordPress.v2.Media. Encountered unexpected character 'o'."
Please help
How to resolve this??? I have a same problem. Thanks!!!
Wordpress version 5.4.1 WooCommerce version 4.0.1 WooCommerce.NET version 0.8.2 .htaccess: RewriteCond %{HTTP:Authorization} ^(.) RewriteRule ^(.) - [E=HTTP_AUTHORIZATION:%1] My code:
RestAPI restwp = new RestAPI("https://test.com/wp-json", "user", "pass"); WooCommerce.NET.WordPress.v2.WPObject wp = new WooCommerce.NET.WordPress.v2.WPObject(restwp); await wp.Media.Add("logo", @"C:\logo.jpg");
Media.Add returns error "There was an error deserializing the object of type WooCommerce.NET.WordPress.v2.Media. Encountered unexpected character 'o'." Please helpHow to resolve this??? I have a same problem. Thanks!!!
Same problem here to.
Wordpress version 5.4.1 WooCommerce version 4.0.1 WooCommerce.NET version 0.8.2 .htaccess: RewriteCond %{HTTP:Authorization} ^(.) RewriteRule ^(.) - [E=HTTP_AUTHORIZATION:%1] My code:
RestAPI restwp = new RestAPI("https://test.com/wp-json", "user", "pass"); WooCommerce.NET.WordPress.v2.WPObject wp = new WooCommerce.NET.WordPress.v2.WPObject(restwp); await wp.Media.Add("logo", @"C:\logo.jpg");
Media.Add returns error "There was an error deserializing the object of type WooCommerce.NET.WordPress.v2.Media. Encountered unexpected character 'o'." Please helpHow to resolve this??? I have a same problem. Thanks!!!
Same problem here to.
I solved the problem by installing on wordpress this plugin: https://wordpress.org/plugins/woo-media-api/
I edited the files to work with woocomerce v3 version. After this, you can add the Media.cs on your project and update the RestApi.cs, both are on zip file above: https://drive.google.com/file/d/1H6TlFz7gF-cXd5Bja3mtfAayz4qFevCK/view?usp=sharing
Hi @HudsonRomeu, Your files uploaded to google drive aren't available anymore. Could you share the adaptations you made to make it compatible with the WooCommerce Media API ? Thanks in advance,