我嘗試使用DELETE方法發送{"id": 190}
postman tool
它的成功。但我不知道如何與蟒蛇請求Python請求使用數據的DELETE方法
請指引我做到這一點。
下面是代碼:
def delete(url, json=None,**kwargs):
return requests.delete(url, json=None,**kwargs)
我嘗試:
delete(url,json={"id":190})
但不下班的500錯誤。
org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
刪除'JSON = None'和調用方法時,使用'刪除(網址:{ 「ID」 :190})'。最後通過'kwargs ['id']獲得id# –