customJsonRequest

inline fun <T> customJsonRequest(builderFn: UnaryOperator<HttpBuilder>): Mono<T>

Send a custom request to the lavalink node. Any host and port you set will be replaced with the node host automatically. The scheme must match your node's scheme, however. The response body will be deserialized using the provided deserializer.

It is recommended to use the path setter instead of the url setter when defining a url, like this:

{@code
customJsonRequest{
    it.path("/some/plugin/path")
                  .get();
}.doOnSuccess {
    if (it == null) {
       println("http 204");
    }
    println(it);
}.subscribe();
}

Return

The Json object from the response body, may error with an IllegalStateException when the node is not available or the response is not successful.

Parameters

builderFn

The request builder function, defaults such as the Authorization header have already been applied


fun <T> customJsonRequest(deserializer: DeserializationStrategy<T>, builderFn: UnaryOperator<HttpBuilder>): Mono<T>

Send a custom request to the lavalink node. Any host and port you set will be replaced with the node host automatically. The scheme must match your node's scheme, however. The response body will be deserialized using the provided deserializer.

It is recommended to use the path setter instead of the url setter when defining a url, like this:

{@code
customJsonRequest(SomeType.Serializer.INSTANCE, (builder) -> {
    return builder.path("/some/plugin/path")
                  .get();
}).doOnSuccess((result) -> {
    if (result == null) {
       println("http 204");
    }
    println(result);
}).subscribe();
}

Return

The Json object from the response body, may error with an IllegalStateException when the node is not available or the response is not successful.

Parameters

deserializer

The deserializer to use for the response body (E.G. LoadResult.Serializer.INSTANCE)

builderFn

The request builder function, defaults such as the Authorization header have already been applied


fun <T> customJsonRequest(decodeTo: Class<T>, builderFn: UnaryOperator<HttpBuilder>): Mono<T>

Send a custom request to the lavalink node. Any host and port you set will be replaced with the node host automatically. The scheme must match your node's scheme, however. The response body will be deserialized using the provided deserializer.

It is recommended to use the path setter instead of the url setter when defining a url, like this:

{@code
customJsonRequest(SomeType.class, (builder) -> {
    return builder.path("/some/plugin/path")
                  .get();
}).doOnSuccess((result) -> {
    if (result == null) {
       println("http 204");
    }
    println(result);
}).subscribe();
}

Return

The Json object from the response body, may error with an IllegalStateException when the node is not available or the response is not successful.

Parameters

decodeTo

The class that jackson will deserialize the response body into.

builderFn

The request builder function, defaults such as the Authorization header have already been applied