-
Notifications
You must be signed in to change notification settings - Fork 110
Closed
Description
Latest WooCommerce and now the latest WordPress. Everything worked fine (last night) before update this morning.
curl https://example.com/wp-json/wc/v1/products/9522 -u key:secret
works fine, it gives the product info. Log on the server side (Apache) is "GET /wp-json/wc/v1/products/9522 HTTP/1.1" 200 6484 "-" "curl/7.47.0"
When using the following python it doesn't work.
from woocommerce import API
wcapi = API(
url="https://example.com",
consumer_key="key",
consumer_secret="secret",
wp_api=True,
version="wc/v1"
)
print(wcapi.get("products/9522").json())
Result: {'data': {'json_error_code': 4, 'json_error_message': 'Syntax error', 'status': 400}, 'code': 'rest_invalid_json', 'message': 'Invalid JSON body passed.'}
Server log: "GET /wp-json/wc/v1/products/9522 HTTP/1.1" 400 4742 "-" "WooCommerce API Client-Python/1.2.0"
I made no changes to code, simply updated WordPress from 4.6 to 4.7
Metadata
Metadata
Assignees
Labels
No labels