woocommerce / woocommerce

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
https://woocommerce.com
9.33k stars 10.75k forks source link

WooCommerce API returns error: "unexpected character at line 1 column 1 of the JSON data" #17765

Closed sergiytravnikov closed 6 years ago

sergiytravnikov commented 6 years ago

https://github.com/woocommerce/woocommerce/issues/new

https://hollyhillvitamins.com/wp-json/wc/v2/products/categories https://hollyhillvitamins.com/wp-json/wc/v2/products and other API methods return response with two empty lines. Screenshot is attached.

I test API in browser. I don't use woocomerce for testing. Firefox returns error: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data. The advice to deactivate all plugins did not help. I think you misunderstand. Plugins are working in WooCommerce. I receive error in API. WooCommerce and WooCommerce API are absolutely different applications. API can not depend on plugins. Just API developer has to remove empty lines from the request. It's easy to fix. Who is an API developer? How to contact API developers? Please, send me an email of API expert?

mikejolley commented 6 years ago

Stop opening duplicates please.

https://github.com/woocommerce/woocommerce/issues/17764