custom Json Request
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
The request builder function, defaults such as the Authorization header have already been applied
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
The deserializer to use for the response body (E.G. LoadResult.Serializer.INSTANCE
)
The request builder function, defaults such as the Authorization header have already been applied
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
The class that jackson will deserialize the response body into.
The request builder function, defaults such as the Authorization header have already been applied