I've built a REST webservice with some webmethods. But I don't get it to work passing parameters to these methods.
I.E.
@GET
@Path("hello")
@Produces(MediaType.TEXT_PLAIN)
public String hello(String firstName, String lastName){
return "Hello " + firstname + " " + lastname
}
How would I invoke that method and how to pass the parameters firstname and lastname? I tried something like this:
ClientConfig config = new DefaultClientConfig();
Client client = Client.create(config);
WebResource service = client.resource(getBaseURI());
ClientResponse response = service.path("hello")
.accept(MediaType.TEXT_PLAIN).put(ClientResponse.class);
But where do I add the parameters?
Thank you for your help, best regards, Chris