From the course: Java EE: RESTful Service with JAX-RS 2.0

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Process the response with JSONP

Process the response with JSONP

From the course: Java EE: RESTful Service with JAX-RS 2.0

Start my 1-month free trial

Process the response with JSONP

- [Instructor] We have already seen how the client API can deserialize the response from the rest end-point, directly to an object such as a response object or a list. The API takes care of processing the JSON object into an object that we want, and saves us from the messy deserialization code. But what if we want to get messy? Or have to, because we don't know the shape of the response? Or, simply, we want a low-level way to access the restful API's response? Well, we can. The JAX-RS API works perfectly well with adjacent processing API, allowing us to write code that accesses the root nodes of the JSON string, in an intuitive, object-orientated way. The JSON API parses and transforms JSON data, and also provides a way to query the data using one of the two models: The object model, and the streaming model. I won't go into much detail about this right now, as there is a specific course dedicated to this topic. However, I will show you how to use the object model to handle the…

Contents