Do you want to
import json mydata = {} mydata['api_key'] = "Jsa9i23jka" r = requests.delete(URL_delete, data=json.dumps(mydata))
You should use a named input, "data", and I assume that you really want to dump JSON, so you need to convert the dictionary "mydata" to a json string. You can use json.dumps () for this.
I don’t know the API that you use, but by its sound you really want to pass the URL parameter, not the data, for this you need:
r = requests.delete(URL_delete, params=mydata)
No need to convert mydata dict to json string.
source share