Package discord4j.rest.request
Class DiscordWebResponse
java.lang.Object
discord4j.rest.request.DiscordWebResponse
Contract to handle a
Mono of ClientResponse after a network exchange is done.-
Constructor Summary
ConstructorsConstructorDescriptionDiscordWebResponse(Mono<ClientResponse> responseMono, ReactorResources reactorResources) -
Method Summary
Modifier and TypeMethodDescription<T> Mono<T>bodyToMono(Class<T> responseClass) Read the response body and extract it to a single object according to theresponseTypegiven.mono()Return the underlyingMonoofClientResponse.skipBody()Consume and release the response body then return and emptyMono.
-
Constructor Details
-
DiscordWebResponse
-
-
Method Details
-
bodyToMono
Read the response body and extract it to a single object according to theresponseTypegiven. If the response has an HTTP error (status codes 4xx and 5xx) the produced object will be aClientException. -
skipBody
Consume and release the response body then return and emptyMono.- Returns:
- an empty
Monoindicating response body consumption and release
-
mono
Return the underlyingMonoofClientResponse.- Returns:
- the original
Monothis response wrapper accesses
-