public class Emp { Client client; String host; String endpoint; public Emp() { this.client = new Client(); this.host = "http://[::1]:8000/api"; this.endpoint = "/employees"; } public String getEmployees() { String url = host + endpoint; String res = client.get(url).join(); return res; } public String addEmployee(String emp) { String token = "eyJhbGci"; Client client = new Client(); String url = host + endpoint; String res = client.post(url, emp, token ).join(); return res; } public String updateEmployee(String emp, Integer id) { String url = this.host + endpoint + "/" + id.toString(); String res = client.put(url, emp ).join(); return res; } public String deleteEmployee(Integer id) { String url = host + endpoint + "/" + id.toString(); String res = client.delete(url).join(); return res; } }