public class DiscordWebClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_REQUEST_TIMESTAMP |
| Constructor and Description |
|---|
DiscordWebClient(HttpClient httpClient,
ExchangeStrategies exchangeStrategies,
String authorizationScheme,
String token,
List<ResponseFunction> responseFunctions)
Create a new
DiscordWebClient wrapping HTTP, Discord and encoding/decoding resources. |
| Modifier and Type | Method and Description |
|---|---|
Mono<ClientResponse> |
exchange(ClientRequest request)
Exchange a request for a
Mono response. |
HttpHeaders |
getDefaultHeaders()
Return the default headers used in every request.
|
ExchangeStrategies |
getExchangeStrategies()
Return the strategy used for request and response conversion.
|
HttpClient |
getHttpClient()
Return the underlying Reactor Netty HTTP client.
|
public static final String KEY_REQUEST_TIMESTAMP
public DiscordWebClient(HttpClient httpClient, ExchangeStrategies exchangeStrategies, String authorizationScheme, String token, List<ResponseFunction> responseFunctions)
DiscordWebClient wrapping HTTP, Discord and encoding/decoding resources.httpClient - a Reactor Netty HTTP clientexchangeStrategies - a strategy to transform requests and responsesauthorizationScheme - scheme to use with the authorization header, like "Bot" or "Bearer"token - a Discord token for API authorizationresponseFunctions - a list of ResponseFunction transformationspublic HttpClient getHttpClient()
DiscordWebClientpublic HttpHeaders getDefaultHeaders()
HttpHeaders used by this DiscordWebClient in every requestpublic ExchangeStrategies getExchangeStrategies()
ExchangeStrategies used by this DiscordWebClient in every requestpublic Mono<ClientResponse> exchange(ClientRequest request)
Mono response.
The request will be processed according to the writer strategies available.
request - the client HTTP requestMono with the response in the form of ClientResponse