Commit d7f74e316428814c4a02f388f1d9d4dacd326c66
API /add accepts a list of sweet, so send the sweet in a list
| | | | 8 | sweet['where'] = where | 8 | sweet['where'] = where |
---|
9 | sweet['how'] = how | 9 | sweet['how'] = how |
---|
10 | sweet_list = [] | 10 | sweet_list = [] |
---|
11 | request = requests.api.post(sweet_url, {'data':json.dumps(sweet)}) | | 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 True | 14 | return True |
---|
14 | else: | 15 | else: |
---|