REST Client
Steps for JAX-RS Client Programming
- Create Client object
- Create WebTarget object
- Build HTTP request (including headers)
- Invoke and receive response
- Domain object
- Response object
- Handle exception
1. Create Client Object
Client & ClientBuilder
- javax.ws.rs.Client object manages client socket connection
- It is an expensive to create this object - it should be reused whenever possible
- Easiest way to create Client object is through ClientBuilder
- Client client = ClientBuilder.newClient();
You must have an active subscription to download PDF and Lab Zip of this course topic.Please click the "Subscribe" button or the "Login" button if you already have an account.