File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717def call (auth , method , endpoint , params = None ):
1818 headers = { "X-Auth-Email" : auth ['EMAIL' ], "X-Auth-Key" : auth ['TOKEN' ] }
1919 url = BASE_URL + '/' + endpoint
20+ method = method .upper ()
2021 logger .debug ("auth is: " + str (auth ))
2122 logger .debug ("method type is: " + method )
2223 logger .debug ("url endpoint is: " + url )
2324 logger .debug ("optional params is: " + str (params ))
2425 if (auth is None ) or (method is None ) or (endpoint is None ):
2526 raise CloudFlareError ('You must specify auth, method, and endpoint' )
2627 else :
27- if method . upper () == 'GET' :
28+ if method == 'GET' :
2829 logger .debug ("headers being sent: " + str (headers ))
2930 response = requests .get (url , headers = headers , params = params )
30- elif method . upper () == 'POST' :
31+ elif method == 'POST' :
3132 headers ['Content-Type' ] = 'application/json'
3233 logger .debug ("headers being sent: " + str (headers ))
3334 response = requests .post (url , headers = headers , json = params )
You can’t perform that action at this time.
0 commit comments