diff options
| author | 2019-01-01 23:28:56 +0100 | |
|---|---|---|
| committer | 2019-01-01 23:28:56 +0100 | |
| commit | 37430e4e69d3a522d6384a1d1a97c005c866705d (patch) | |
| tree | 0902a4a728db35f8b628b358372ab9479dcfe40b | |
| parent | Send users one by one. (diff) | |
Add `PUT` support in API client.
| -rw-r--r-- | bot/api.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/api.py b/bot/api.py index f8757d3d0..0a2c192ce 100644 --- a/bot/api.py +++ b/bot/api.py @@ -33,6 +33,10 @@ class APIClient: async with self.session.post(self._url_for(endpoint), *args, **kwargs) as resp: return await resp.json() + async def put(self, endpoint: str, *args, **kwargs): + async with self.session.put(self._url_for(endpoint), *args, **kwargs) as resp: + return await resp.json() + async def delete(self, endpoint: str, *args, **kwargs): async with self.session.delete(self._url_for(endpoint), *args, **kwargs) as resp: if resp.status == 204: |