Interface BodyCodec<T>
-
Method Summary
Modifier and TypeMethodDescriptionbuffer()static <U> BodyCodec<U> Create and return a codec for Java objects encoded using Jackson mapper.static BodyCodec<JsonObject> jsonStream(JsonParser parser) A body codec that parse the response as a JSON stream.none()pipe(WriteStream<Buffer> stream) A body codec that pipes the body to a write stream.pipe(WriteStream<Buffer> stream, boolean close) A body codec that pipes the body to a write stream.sseStream(Handler<ReadStream<SseEvent>> handler) A body codec that parse the response as a Server-SentEvent stream.stream()Create theBodyStream.static <T> BodyCodec<T> Create a codec that buffers the entire body and then apply thedecodefunction and returns the result.string()A codec for strings using a specificencoding.
-
Method Details
-
string
-
string
-
buffer
-
jsonObject
- Returns:
- the
JsonObjectcodec
-
jsonArray
-
json
-
none
-
stream
-
pipe
A body codec that pipes the body to a write stream. Same as pipe(stream, true).- Parameters:
stream- the destination stream- Returns:
- the body codec for a write stream
-
pipe
A body codec that pipes the body to a write stream.- Parameters:
stream- the destination streamclose- whether the destination stream should be closed- Returns:
- the body codec for a write stream
-
jsonStream
A body codec that parse the response as a JSON stream.- Parameters:
parser- the non-null JSON parser to emits the JSON object. The parser must be configured for the stream. Not e that you need to keep a reference on the parser to retrieved the JSON events.- Returns:
- the body codec for a write stream
-
sseStream
A body codec that parse the response as a Server-SentEvent stream.- Parameters:
handler- the non-nullhandlerfor the stream of Server-Sent Events.- Returns:
- the body codec for a write stream
-
stream
Create theBodyStream.This method is usually called for creating the pump for the HTTP response and should not be called directly.
- Throws:
Exception
-