[FIX] jsonRequest

This commit is contained in:
Gravit'a 2021-08-07 03:02:47 +07:00
parent 0ab9327c74
commit 19344b9d27

View file

@ -44,7 +44,7 @@ public class JsonCoreProvider extends AuthCoreProvider {
public static <T, R> R jsonRequest(T request, String url, String bearerToken, Class<R> clazz, HttpClient client) {
HttpRequest.BodyPublisher publisher;
if (request != null) {
publisher = HttpRequest.BodyPublishers.ofString(request.toString());
publisher = HttpRequest.BodyPublishers.ofString(Launcher.gsonManager.gson.toJson(request));
} else {
publisher = HttpRequest.BodyPublishers.noBody();
}