mirror of
https://github.com/MelisaDev/melisa.git
synced 2024-11-11 19:07:28 +03:00
http DELETE request method
This commit is contained in:
parent
edc8343d98
commit
81f0c56079
1 changed files with 30 additions and 3 deletions
|
@ -72,7 +72,7 @@ class HTTPClient:
|
|||
params: Optional[Dict] = None
|
||||
) -> Optional[Dict]:
|
||||
"""|coro|
|
||||
Sends a GET request to a Discord REST endpoint.
|
||||
Sends a GET request to a Discord REST API endpoint.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
@ -98,7 +98,7 @@ class HTTPClient:
|
|||
data: Optional[Dict] = None
|
||||
) -> Optional[Dict]:
|
||||
"""|coro|
|
||||
Sends a POST request to a Discord REST endpoint.
|
||||
Sends a POST request to a Discord REST API endpoint.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
@ -110,7 +110,7 @@ class HTTPClient:
|
|||
Returns
|
||||
-------
|
||||
Optional[:class:`Dict`]
|
||||
JSON response from the discord API.
|
||||
JSON response from the Discord API.
|
||||
"""
|
||||
return await self.__send(
|
||||
"POST",
|
||||
|
@ -118,3 +118,30 @@ class HTTPClient:
|
|||
json=data,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
route: str,
|
||||
headers: dict = None
|
||||
) -> Optional[Dict]:
|
||||
"""|coro|
|
||||
Sends a DELETE request to a Discord REST API endpoint.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
route : :class:`str`
|
||||
The endpoint to send the request to.
|
||||
headers : :class:`dict`
|
||||
Custom request headers
|
||||
|
||||
Returns
|
||||
-------
|
||||
Optional[:class:`Dict`]
|
||||
JSON response from the Discord API.
|
||||
"""
|
||||
return await self.__send(
|
||||
"DELETE",
|
||||
route,
|
||||
headers=headers
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue