diff --git a/woocommerce/api.py b/woocommerce/api.py index a97c901..0810428 100644 --- a/woocommerce/api.py +++ b/woocommerce/api.py @@ -10,6 +10,7 @@ __license__ = "MIT" from requests import request +from requests import Session from json import dumps as jsonencode from time import time from woocommerce.oauth import OAuth @@ -31,6 +32,7 @@ def __init__(self, url, consumer_key, consumer_secret, **kwargs): self.verify_ssl = kwargs.get("verify_ssl", True) self.query_string_auth = kwargs.get("query_string_auth", False) self.user_agent = kwargs.get("user_agent", f"WooCommerce-Python-REST-API/{__version__}") + self.s = Session() def __is_ssl(self): """ Check if url use HTTPS """ @@ -89,7 +91,7 @@ def __request(self, method, endpoint, data, params=None, **kwargs): data = jsonencode(data, ensure_ascii=False).encode('utf-8') headers["content-type"] = "application/json;charset=utf-8" - return request( + return self.s.request( method=method, url=url, verify=self.verify_ssl, pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy