Skip to content

400 errors after updating to Wordpress 4.7 #23

@shopro

Description

@shopro

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions