This file looks large and may slow your browser down if we attempt
to syntax highlight it, so we are showing it without any
pretty colors.
Highlight
it anyway.
1 |
import requests |
2 |
import json |
3 |
|
4 |
def sweet(sweet_url, what, who, where, how): |
5 |
sweet = {} |
6 |
sweet['what'] = what |
7 |
sweet['who'] = who |
8 |
sweet['where'] = where |
9 |
sweet['how'] = how |
10 |
sweet_list = [] |
11 |
sweet_list.append(sweet) |
12 |
request = requests.api.post(sweet_url, {'data':json.dumps(sweet_list)}) |
13 |
if request.status_code == 200: |
14 |
return True |
15 |
else: |
16 |
return False |