@@ -26,6 +26,7 @@ def __init__(self, url, consumer_key, consumer_secret, **kwargs):
26
26
self .is_ssl = self .__is_ssl ()
27
27
self .timeout = kwargs .get ("timeout" , 5 )
28
28
self .verify_ssl = kwargs .get ("verify_ssl" , True )
29
+ self .query_string_auth = kwargs .get ("query_string_auth" , False )
29
30
30
31
def __is_ssl (self ):
31
32
""" Check if url use HTTPS """
@@ -60,14 +61,20 @@ def __request(self, method, endpoint, data):
60
61
""" Do requests """
61
62
url = self .__get_url (endpoint )
62
63
auth = None
64
+ params = {}
63
65
headers = {
64
66
"user-agent" : "WooCommerce API Client-Python/%s" % __version__ ,
65
67
"content-type" : "application/json;charset=utf-8" ,
66
68
"accept" : "application/json"
67
69
}
68
70
69
- if self .is_ssl is True :
71
+ if self .is_ssl is True and self . query_string_auth is False :
70
72
auth = (self .consumer_key , self .consumer_secret )
73
+ elif self .is_ssl is True and self .query_string_auth is True :
74
+ params = {
75
+ "consumer_key" : self .consumer_key ,
76
+ "consumer_secret" : self .consumer_secret
77
+ }
71
78
else :
72
79
url = self .__get_oauth_url (url , method )
73
80
@@ -79,6 +86,7 @@ def __request(self, method, endpoint, data):
79
86
url = url ,
80
87
verify = self .verify_ssl ,
81
88
auth = auth ,
89
+ params = params ,
82
90
data = data ,
83
91
timeout = self .timeout ,
84
92
headers = headers
0 commit comments