public final Result request(Environment env) throws IOException { if (env == null) { throw new RuntimeException("Environment cannot be null"); } String url = new StringBuilder(env.apiBaseUrl()).append(uri).toString(); switch (httpMeth) { case GET: return HttpUtil.get(url, params(), jsonString, env); case POST: return HttpUtil.post(url, params(), jsonString, env); case PUT: return HttpUtil.put(url, params(), jsonString, env); default: throw new RuntimeException("Not handled type [" + httpMeth + "]"); } }
public final Result request() throws IOException { return request(Environment.defaultConfig()); }