public class Auth { Client client; String host; String endpoint; public Auth() { this.client = new Client(); this.host = "http://[::1]:8000/api"; this.endpoint = "/login"; } public String login(String data) { Client client = new Client(); String url = host + endpoint; String res = client.post(url, data ).join(); return res; } }