Package discord4j.rest.request
Class DiscordWebResponse
- java.lang.Object
-
- discord4j.rest.request.DiscordWebResponse
-
public class DiscordWebResponse extends Object
Contract to handle aMonoofClientResponseafter a network exchange is done.
-
-
Constructor Summary
Constructors Constructor Description DiscordWebResponse(Mono<ClientResponse> responseMono, ReactorResources reactorResources)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Mono<T>bodyToMono(Class<T> responseClass)Read the response body and extract it to a single object according to theresponseTypegiven.Mono<ClientResponse>mono()Return the underlyingMonoofClientResponse.Mono<Void>skipBody()Consume and release the response body then return and emptyMono.
-
-
-
Constructor Detail
-
DiscordWebResponse
public DiscordWebResponse(Mono<ClientResponse> responseMono, ReactorResources reactorResources)
-
-
Method Detail
-
bodyToMono
public <T> Mono<T> bodyToMono(Class<T> responseClass)
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
public Mono<Void> skipBody()
Consume and release the response body then return and emptyMono.- Returns:
- an empty
Monoindicating response body consumption and release
-
mono
public Mono<ClientResponse> mono()
Return the underlyingMonoofClientResponse.- Returns:
- the original
Monothis response wrapper accesses
-
-