• 1.20.1

Managing JSON Responses

When your HTTP Response contains a JSON document, it is convenient to use JsonResponse decorator to manipulate it, for example:

String name = new JdkRequest("http://my.example.com")
  .json() // convert HTTP body to javax.json.JsonReader

Method JsonResponse#json() converts HTTP body to an instance of class JsonReader.

Don't forget to add these two dependencies to your classpath:


Read also about RestResponse, which helps you to manage default HTTP response concepts.