How to get list as response from jersey2 client

You can get your service response as Response class object and, then parse this object using readEntity(...) method.

Here is a quick code snippet:

List<String> list = client
                      .target(url)
                      .request(MediaType.APPLICATION_JSON)
                      .get(Response.class)
                      .readEntity(new GenericType<List<String>>() {});
/* Do something with the list object */

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)