File tree Expand file tree Collapse file tree
httpcore5-jackson2/src/test/java/org/apache/hc/core5/jackson2/http/examples Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444import org .apache .hc .core5 .reactor .IOReactorConfig ;
4545import org .apache .hc .core5 .util .Timeout ;
4646
47+ /**
48+ * This example demonstrates how an HTTP response JSON content can be consumed as
49+ * Jackson JsonNode object.
50+ * <p>
51+ * Please note content of incoming and outgoing HTTP messages gets streamed without making
52+ * a copy of the message body content in an intermediate buffer.
53+ * <p>
54+ * This example uses {@link AsyncJsonClientPipeline} to simply HTTP message execution pipeline
55+ * assembly. One can also use JSON message request producers and response consumers directly.
56+ */
4757public class JsonNodeResponseExample {
4858
4959 public static void main (final String ... args ) throws Exception {
Original file line number Diff line number Diff line change 4747import org .apache .hc .core5 .reactor .IOReactorConfig ;
4848import org .apache .hc .core5 .util .Timeout ;
4949
50+ /**
51+ * This example demonstrates how a plain Java Object can be serialized as a request
52+ * content body in JSON format and an HTTP response JSON content can be consumed as
53+ * a plain Java Object compatible with Jackson JSON bindings.
54+ *
55+ * <p>
56+ * Please note content of incoming and outgoing HTTP messages gets streamed without making
57+ * a copy of the message body content in an intermediate buffer.
58+ * <p>
59+ * This example uses {@link AsyncJsonClientPipeline} to simply HTTP message execution pipeline
60+ * assembly. One can also use JSON message request producers and response consumers directly.
61+ */
5062public class JsonObjectRequestExample {
5163
5264 public static void main (final String ... args ) throws Exception {
Original file line number Diff line number Diff line change 5050import org .apache .hc .core5 .reactor .IOReactorConfig ;
5151import org .apache .hc .core5 .util .Timeout ;
5252
53+ /**
54+ * This example demonstrates how to stream out a sequence plain Java Objects compatible
55+ * with Jackson JSON bindings as a request content body in JSON format.
56+ *
57+ * <p>
58+ * Please note content of incoming and outgoing HTTP messages gets streamed without making
59+ * a copy of the message body content in an intermediate buffer.
60+ * <p>
61+ * This example uses {@link AsyncJsonClientPipeline} to simply HTTP message execution pipeline
62+ * assembly. One can also use JSON message request producers and response consumers directly.
63+ */
5364public class JsonSequenceRequestExample {
5465
5566 public static void main (final String ... args ) throws Exception {
Original file line number Diff line number Diff line change 4343import org .apache .hc .core5 .reactor .IOReactorConfig ;
4444import org .apache .hc .core5 .util .Timeout ;
4545
46+ /**
47+ * This example demonstrates how an HTTP response content can be consumed as a sequence
48+ * of plain Java Objects compatible with Jackson JSON bindings.
49+ *
50+ * <p>
51+ * Please note content of incoming and outgoing HTTP messages gets streamed without making
52+ * a copy of the message body content in an intermediate buffer.
53+ * <p>
54+ * This example uses {@link AsyncJsonClientPipeline} to simply HTTP message execution pipeline
55+ * assembly. One can also use JSON message request producers and response consumers directly.
56+ */
4657public class JsonSequenceResponseExample {
4758
4859 public static void main (final String ... args ) throws Exception {
Original file line number Diff line number Diff line change 5757import org .apache .hc .core5 .util .TimeValue ;
5858
5959/**
60- * Example of asynchronous embedded JSON server.
60+ * Example of asynchronous embedded HTTP server that exchanges messages in JSON format.
61+ * <p>
62+ * Please note content of incoming and outgoing HTTP messages gets streamed without making
63+ * a copy of the message body content in an intermediate buffer.
64+ * <p>
65+ * This example uses {@link AsyncJsonServerPipeline} to simply HTTP message execution pipeline
66+ * assembly. One can also use JSON message consumers and response producers directly.
6167 */
6268public class JsonServerExample {
6369
Original file line number Diff line number Diff line change 4343import org .apache .hc .core5 .reactor .IOReactorConfig ;
4444import org .apache .hc .core5 .util .Timeout ;
4545
46+ /**
47+ * This example demonstrates how an HTTP response JSON content can be consumed as
48+ * a stream of events.
49+ * <p>
50+ * Please note content of incoming and outgoing HTTP messages gets streamed without making
51+ * a copy of the message body content in an intermediate buffer.
52+ * <p>
53+ * This example uses {@link AsyncJsonClientPipeline} to simply HTTP message execution pipeline
54+ * assembly. One can also use JSON message request and response consumers directly.
55+ */
4656public class JsonTokenEventResponseExample {
4757
4858 public static void main (final String ... args ) throws Exception {
You can’t perform that action at this time.
0 commit comments