I have a method in my rest interface which looks like this:
@POST
@Path("/path/{param1}/{param2}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
Response updateData(@PathParam("param1") String param1,
@PathParam("param2") String param2,
String dataPointJson);
I'm trying without success to do a post request, here's my code:
WebTarget path = collect.path("/path/someParam1/" + someParam2);
Data dp = new Data.Builder()
Response post = path.request().post(Entity.json(dp));
Every time I get a 404 response:
ClientResponse{method=POST, uri=http://localhost:9090/collect/path/someParam1/someParam2, status=404, reason=Not Found}
Can someone please suggest what I'm doing wrong? Tried different combinations of "consumes"/"produces", also tried all examples from tutorials which I found on the net.