単純な端末クライアントから投稿要求を呼び出す方法を教えてもらえますか?クライアントで単純な端末クライアントからのジャージPOSTリクエスト
@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);
}
私が行います
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
でテストされましたか?どのような例外がありますか? –
あなたはcurlコマンドを試しましたか? –
@ MaximDobryakov私は例外が表示されません私はクライアントから要求を送信する方法を知りません。私はURLとリソースを持っていますが、どのようにクライアントからリクエストを送信するのですか? – kvway