87👍
✅
Use requests.delete instead of requests.post
payload = {'some':'data'}
headers = {'content-type': 'application/json'}
url = "https://www.toggl.com/api/v6/" + data_description + ".json"
response = requests.delete(
url,
data=json.dumps(payload),
headers=headers,
auth=HTTPBasicAuth(toggl_token, 'api_token')
)
-1👍
import requests
url = 'url.example.ap'
headers = {
'content-type': "multipart/form-data; boundary=---- ",
'X-Auth-Token': ""anytoken"",
'Cache-Control': "no-cache"
}
r = requests.delete(url, headers=headers)
n = os.write(sys.stdout.fileno(), r.content)
print r.content == r.text
- [Django]-Download a remote image and save it to a Django model
- [Django]-Database returned an invalid value in QuerySet.dates()
- [Django]-Custom django admin templates not working
Source:stackexchange.com