Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 403 error when using WooCommerce API (Python) #230

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

Matin-B
Copy link

@Matin-B Matin-B commented May 9, 2023

This pull request fixes an issue where a 403 error was returned when trying to use the WooCommerce API in Python. The issue was caused by the lack of a User-Agent header in the API requests.

To fix the issue, a User-Agent header has been added to the API requests, with the value "sample.org" (or anything else).

Changes made:

  • Added a User-Agent header to the API requests with the value "sample.org".

Example usage:

from woocommerce import API

wcapi = API(
    url="http://example.com",
    consumer_key="consumer_key",
    consumer_secret="consumer_secret",
    version="v2",
    user_agent="sample.org", # Your sample user agent
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant