Add DELETE support for generic web API client
This commit is contained in:
parent
056307b937
commit
3b0d479ebf
|
@ -82,6 +82,12 @@ class GenericWebAPI:
|
|||
kwargs['data'] = json.dumps(data)
|
||||
response = self.session.patch(url, **kwargs)
|
||||
|
||||
elif request_method == 'DELETE':
|
||||
kwargs = {'params': params}
|
||||
if data:
|
||||
kwargs['data'] = json.dumps(data)
|
||||
response = self.session.delete(url, **kwargs)
|
||||
|
||||
else:
|
||||
raise NotImplementedError(f"unknown request method: {request_method}")
|
||||
|
||||
|
|
Loading…
Reference in a new issue