Consume REST service with Java 6

2.4k Views Asked by At

I'm trying to consume REST service, with Java 6 on RAD, with regular jax-rs code:

        Client client = ClientBuilder.newClient();
        WebTarget target = client.target("http://host:8080/context/rest/method");
        JsonArray response = target.request(MediaType.APPLICATION_JSON).get(JsonArray.class);

The problem: It doesn't have - javax.ws.rs.client.* packages;

How can I implement a simple client, using jax-rs with Java 6?

Thanks!

1

There are 1 best solutions below

2
Gabriel PASCUAL On

Did you try with an implementation library of JAX-RS like Jersey(https://eclipse-ee4j.github.io/jersey/) or RESTEasy(https://resteasy.github.io)?