Commit 72e6588b by Rocky Duan

Merge branch 'master' into refactor

parents 07f818da 22657130
......@@ -6,3 +6,5 @@ else:
SERVICE_HOST = 'http://localhost:4567'
PREFIX = SERVICE_HOST + '/api/v1'
API_KEY = "PUT_YOUR_API_KEY_HERE"
import requests
import json
import settings
def strip_none(dic):
return dict([(k, v) for k, v in dic.iteritems() if v is not None])
......@@ -19,6 +20,7 @@ def merge_dict(dic1, dic2):
return dict(dic1.items() + dic2.items())
def perform_request(method, url, data_or_params=None, *args, **kwargs):
data_or_params['api_key'] = settings.API_KEY
if method in ['post', 'put', 'patch']:
response = requests.request(method, url, data=data_or_params)
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment