擅长:python、mysql、java
<p>您可以按照@Eugene的建议发送数据参数,但通常的delete请求只包含url而不包含其他内容。原因是RESTful url应该唯一地标识资源,从而消除了为删除提供额外参数的需要。另一方面,如果“APIKEY”与身份验证有关,那么它应该是头的一部分,而不是请求数据,如下所示。</p>
<pre><code>headers = {'APIKEY': 'xxx'}
response = requests.delete(url, data=json.dumps(payload), headers=headers)
</code></pre>