The function requests.deletehas the following signature:
requests.delete(url, **kwargs)
There is only one required positional argument,, urland the rest must be keyword arguments, the same as for requests.request.
Yours json.dumps(data), of course, does not give the correct format for the keyword arguments. If you just want to pass this JSON as data, follow these steps:
requests.delete(url, data=json.dumps(data))
source
share