Beispiel #1
0
 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 + "]");
   }
 }
Beispiel #2
0
 public final Result request() throws IOException {
   return request(Environment.defaultConfig());
 }