tree: 929e3d244d449cd8e2a726b4f9bf353af4ee3ada [path history] [tgz]
  1. src/
  2. pom.xml
  3. README.MD
examples/expect-100-continue-netty-client/README.MD

jersey-example-expect-100-continue-netty-connector

This example demonstrates how to register and run Jersey Netty connector with Expect:100-continue feature on. It also provides custom low-level Socket server to demonstrate how is request is captured and processed.

Contents

The server and client are operating on requests level, without exposing any Resources. Client only sends request in form

{"message":"Hello from java client"}

Sample Response

Server in turn shows output which demonstrates Expect:100-continue presence and handling

==== DUMPING HEADERS ====
expect, 100-continue
transfer-encoding, chunked
host, 127.0.0.1:3000
content-type, application/json
accept, application/json
user-agent, jersey/2.47-snapshot (netty 4.1.112.final)
==== HEADERS DUMPED =====
==== DUMPING RESPONSE ====
HTTP/1.1 100 Continue
Connection: keep-alive


==== RESPONSE DUMPED =====
24
{"message":"Hello from java client"}
==== DUMPING RESPONSE ====
HTTP/1.1 204 No Content
Server: Socket Server v.0.0.1


Running the Example

Run the example using provided ServerSocket container as follows:

mvn clean compile exec:java

Run the example using client as follows:

mvn clean package exec:java -Pclient