janschill / uni-client_server

Client-Server: RESTful Java web app with Jersey and an Android client
0 stars 0 forks source link

form java client #1

Open janschill opened 6 years ago

janschill commented 6 years ago

Form form = new Form(); form.param("name", "Alyssa William") .param("address", "1021 Hweitt Street") .param("phone-number", "343-343-3433");

Client client = ClientBuilder.newClient(); WebTarget target = client.target("http://www.example.com/api/customers"); Future response = target. request(MediaType.APPLICATION_FORM_URLENCODED) .accept(MediaType.TEXT_PLAIN) .buildPost(Entity.form(form)).submit(String.class);