Hello Chris,

I know this may not be elegant, but the simple solution our team uses, is
that we simply construct the String argument for the client.resource()
method on the fly for each request.

E.g.
client.resource("http://server/path/to/resource/"+someId);

This has worked for us in wide variety of test code and client code for our
API.

Regards,
Brian

On Fri, Feb 20, 2015 at 11:00 AM, 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