Package pro.gravit.launchserver.helper
Class HttpHelper
java.lang.Object
pro.gravit.launchserver.helper.HttpHelper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic interfacestatic interfacestatic class -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> HttpRequest.BodyPublisherjsonBodyPublisher(T obj) static <T> HttpResponse.BodyHandler<T>ofJsonResult(Class<T> type) static <T> HttpResponse.BodyHandler<T>ofJsonResult(Type type) static <T,E> HttpHelper.HttpOptional<T, E> send(HttpClient client, HttpRequest request, HttpHelper.HttpErrorHandler<T, E> handler) static <T,E> CompletableFuture<HttpHelper.HttpOptional<T, E>> sendAsync(HttpClient client, HttpRequest request, HttpHelper.HttpErrorHandler<T, E> handler)
-
Method Details
-
send
public static <T,E> HttpHelper.HttpOptional<T,E> send(HttpClient client, HttpRequest request, HttpHelper.HttpErrorHandler<T, E> handler) throws IOException- Throws:
IOException
-
sendAsync
public static <T,E> CompletableFuture<HttpHelper.HttpOptional<T,E>> sendAsync(HttpClient client, HttpRequest request, HttpHelper.HttpErrorHandler<T, E> handler) throws IOException- Throws:
IOException
-
ofJsonResult
-
ofJsonResult
-
jsonBodyPublisher
-