I'm using jax-rs library to create a client testing a Web Service by sending HTTP requests to it, for study purposes. Now a POST Request looks something like this:
Response res = target.
request().post(Entity.entity(jinput.toString(), MediaType.APPLICATION_JSON));
and GET Request something like this:
Response res = target.
request().accept(MediaType.APPLICATION_JSON).get(Response.class);
Where target
is the targeted URI and jinput
the JSON Input used to post a resource...
Now I wonder... is there a way I can send a GET Request accompanied with a JSON input? For the sake of testing how the Web Service reacts to it...
By using cURL to manually send HTTP requests I can do it... but is there a way I can do it using the jax-rs library?
Thanks in advance :)
P.S. I would like to test the same thing with a DELETE Request as well... if possible...