code: public static String get(String url,Map<String, String> queryParams,
              Map<String, String> headers) throws HttpException {
          try {
          	if(queryParams!=null && queryParams.size()>0){
          		for (Map.Entry<String, String> entry : queryParams.entrySet()) {
          			url=appendQueryParams(url, entry.getKey(), entry.getValue());
  				}
          	}
              HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
              connection.setRequestMethod("GET");
              connection.setConnectTimeout(3000);
              connection.setDoInput(true);
              if (headers != null && !headers.isEmpty()) {
                  for (Map.Entry<String, String> entry : headers.entrySet()) {
                      connection.setRequestProperty(entry.getKey(), entry.getValue());
                  }
              }
  
              InputStream is = null;
              InputStreamReader isr = null;
              BufferedReader reader = null;
              try {
                  int code = connection.getResponseCode();
  
                  if (code >= HttpURLConnection.HTTP_BAD_REQUEST) {
                      is = connection.getErrorStream();
                      isr = new InputStreamReader(is, "UTF-8");
                      reader = new BufferedReader(isr);
  
                      StringBuilder sb = new StringBuilder();
                      do {
                          String line = reader.readLine();
                          if (line == null) {
                              break;
                          }
                          sb.append(line);
                      } while (true);
  
                      throw new HttpException(code,
                              "get request [" + url + "] error with response code [" + code + "] " +
                                      "\nerror message: " + sb.toString());
                  }
  
                  is = connection.getInputStream();
                  isr = new InputStreamReader(is,"UTF-8");
                  reader = new BufferedReader(isr);
                  StringBuilder sb = new StringBuilder();
                  do {
                      String line = reader.readLine();
                      if(null == line){
                          break;
                      }
                      sb.append(line);
                  } while (true);
                  return sb.toString();
              } finally {
                  if(reader != null){
                      reader.close();
                  }
                  if(isr != null){
                      isr.close();
                  }
                  if (is != null) {
                      is.close();
                  }
                  connection.disconnect();
              }
          } catch (IOException e) {
              throw new RuntimeException(e.getMessage(), e);
          }
      }
docs: 使用http get方法调用指定url并返回结果