From 37430e4e69d3a522d6384a1d1a97c005c866705d Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Tue, 1 Jan 2019 23:28:56 +0100 Subject: Add `PUT` support in API client. --- bot/api.py | 4 ++++ 1 file changed, 4 insertions(+) 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: -- cgit v1.2.3