擅长:python、mysql、java
<p>使用<a href="http://docs.python-requests.org/en/latest/api/?highlight=delete#requests.delete" rel="nofollow noreferrer">requests.delete</a>而不是<code>requests.post</code></p>
<pre class="lang-py prettyprint-override"><code>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')
)
</code></pre>