Skip to content

Commit

Permalink
uppercase method once
Browse files Browse the repository at this point in the history
  • Loading branch information
fawaf committed Mar 18, 2015
1 parent 710dbf9 commit f3cba51
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cloudflare_v4/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@
def call(auth, method, endpoint, params=None):
headers = { "X-Auth-Email": auth['EMAIL'], "X-Auth-Key": auth['TOKEN'] }
url = BASE_URL + '/' + endpoint
method = method.upper()
logger.debug("auth is: " + str(auth))
logger.debug("method type is: " + method)
logger.debug("url endpoint is: " + url)
logger.debug("optional params is: " + str(params))
if (auth is None) or (method is None) or (endpoint is None):
raise CloudFlareError('You must specify auth, method, and endpoint')
else:
if method.upper() == 'GET':
if method == 'GET':
logger.debug("headers being sent: " + str(headers))
response = requests.get(url, headers=headers, params=params)
elif method.upper() == 'POST':
elif method == 'POST':
headers['Content-Type'] = 'application/json'
logger.debug("headers being sent: " + str(headers))
response = requests.post(url, headers=headers, json=params)
Expand Down

0 comments on commit f3cba51

Please sign in to comment.