- java.lang.Object
-
- io.github.nstdio.http.ext.BodyHandlers
-
public final class BodyHandlers extends java.lang.ObjectImplementations ofBodyHandler's.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBodyHandlers.DecompressingBodyHandlerBuilderThe builder for decompressing body handler.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BodyHandlers.DecompressingBodyHandlerBuilderdecompressingBuilder()Creates newDecompressingBodyHandlerBuilderinstance.static java.net.http.HttpResponse.BodyHandler<java.io.InputStream>ofDecompressing()Wraps response bodyInputStreamin on-the-fly decompressingInputStreamin accordance with Content-Encoding header semantics.static <T> java.net.http.HttpResponse.BodyHandler<T>ofDecompressing(java.net.http.HttpResponse.BodyHandler<T> downstream)static <T> java.net.http.HttpResponse.BodyHandler<java.util.function.Supplier<T>>ofJson(java.lang.Class<T> targetType)Creates body handler to map JSON response totargetType.
-
-
-
Method Detail
-
ofDecompressing
public static java.net.http.HttpResponse.BodyHandler<java.io.InputStream> ofDecompressing()
Wraps response bodyInputStreamin on-the-fly decompressingInputStreamin accordance with Content-Encoding header semantics.- Returns:
- The decompressing body handler.
-
ofDecompressing
public static <T> java.net.http.HttpResponse.BodyHandler<T> ofDecompressing(java.net.http.HttpResponse.BodyHandler<T> downstream)
-
ofJson
public static <T> java.net.http.HttpResponse.BodyHandler<java.util.function.Supplier<T>> ofJson(java.lang.Class<T> targetType)
Creates body handler to map JSON response totargetType.- Type Parameters:
T- The required type.- Parameters:
targetType- The type.- Returns:
- The JSON body handler.
-
decompressingBuilder
public static BodyHandlers.DecompressingBodyHandlerBuilder decompressingBuilder()
Creates newDecompressingBodyHandlerBuilderinstance.- Returns:
- The builder for decompressing body handler.
-
-