Could anyone tell me how to call post request from simple terminal client?
@POST
@Path("insertt")
public void insert(@QueryParam("id") Integer id,
@QueryParam("name") String name,
@QueryParam("lastname") String lastname,
@QueryParam("adress") String adress,
@QueryParam("city") String city ) {
Customer cust = new Customer();
cust.setCustomerId(id);
cust.setName(name);
cust.setLastNAme(lastname);
cust.setAddressline1(adress);
cust.setCity(city);
customerDAO.add( cust );
}
In client I do:
Client c = ClientBuilder.newClient();
WebTarget resource = c.target("http://localhost:8080/WebService/webresources/generic/insertt?id=100&name=test&lastname=test&adress=test&city=test");
//resource.request().post(); // This does not work