If you can use UriBuilder (
http://docs.oracle.com/javaee/6/api/index.html?javax/ws/rs/core/UriBuilder.html
) depending of you wink version,

you write :
UriBuilder builder = UriBuilder.fromUri("http://localhost:9080/ws/api";)
.path("getuserbyid")
.path("{userId}");
RestClient client = new RestClient();
Resource res = client.resource( builder.build("0123456789abcdef") );


On Fri, Feb 20, 2015 at 5:00 PM, Chris Wolf <[email protected]> wrote:

> I've seen plenty examples of performing an HTTP GET via Wink client,
> but no example using a path parameter.  I cannot get this to work. The
> documentation only shows the server-side code, not client:
> http://wink.apache.org/1.0/html/JAX-RS%20Parameters.html
>
> The only thing I could come up with is recreating the Resource, for
> each unique parameter value, e.g.
>
> Resource resource =
> client.resource("http://localhost:9080/ws/api/getuserbyid/0123456789abcdef
> ");
>
> ClientResponse response = resource
>    .contentType("application/json")
>    .accept("application/json")
>    .get();
>     og.info(response.getEntity(String.class));
>
> Isn't there some way to parameterize the last path component?
>
> Thanks,
>
> Chris Wolf
>

Reply via email to