Commit d7f74e316428814c4a02f388f1d9d4dacd326c66

  • avatar
  • arvind
  • Tue Jun 25 17:18:57 IST 2013
API /add accepts a list of sweet, so send the sweet in a list
  • Diff rendering mode:
  • inline
  • side by side

sweetmaker.py

8 sweet['where'] = where8 sweet['where'] = where
9 sweet['how'] = how9 sweet['how'] = how
10 sweet_list = []10 sweet_list = []
11 request = requests.api.post(sweet_url, {'data':json.dumps(sweet)})
11 sweet_list.append(sweet)
12 request = requests.api.post(sweet_url, {'data':json.dumps(sweet_list)})
12 if request.status_code == 200:13 if request.status_code == 200:
13 return True14 return True
14 else:15 else: