Woocommerce REST API JSON Error URGENT
-
I have a problem with Rest Api, I am using Automattic Woocommerce Rest Api to search categories, I am getting this error:
PHP Fatal error: Uncaught Automattic\WooCommerce\HttpClient\HttpClientException: JSON ERROR: Syntax error
This is my configuration for api
$woocommerce = new Client( 'https://url', 'ck_xxxxxxxxxxxxxx', 'cs_xxxxxxxxxxxxx', [ 'version' => 'wc/v3', 'timeout' => 0 ] );
I am sending GET Request
$woocommerce->get('products/categories?search=E?itim Hizmeti');
it returs json syntax error,the problem is it returns error for specific search string for example if i use above string it will return error but if i will use this$woocommerce->get('products/categories?search=Acil Durum & Güvenlik Ekipman');
it will give perfect response without error, for the first request I get body as html 400 bad request cloudflare, I tried to close cloudflare and it still gives me the same error, I checked permalinks and it is okay, I deactivated some plugins still get this error, I tested both request in postman it works perfectly, then I tested with different server and url both request works.
If someone has solution I would be appreciative, I spend almost 2 days to find a problem where does it come from.
- The topic ‘Woocommerce REST API JSON Error URGENT’ is closed to new replies.