http put method

This commit is contained in:
grey-cat-1908 2022-04-05 22:50:09 +03:00
parent 9fee8dda21
commit 9895dc9d55

View file

@ -238,3 +238,26 @@ class HTTPClient:
JSON response from the Discord API.
"""
return await self.__send("PATCH", route, json=data, headers=headers)
async def put(
self, route: str, *, headers: dict = None, data: Optional[Dict] = None
) -> Optional[Dict]:
"""|coro|
Sends a PUT request to a Discord REST API endpoint.
Parameters
----------
route : :class:`str`
The endpoint to send the request to.
data : Dict
Data to post
headers : :class:`dict`
Custom request headers
Returns
-------
Optional[:class:`Dict`]
JSON response from the Discord API.
"""
return await self.__send("PUT", route, json=data, headers=headers)