Explorar el Código

Merge remote-tracking branch 'origin/master'

buzhanyi hace 1 año
padre
commit
1b096972f6

+ 9 - 0
base-common/src/main/java/com/ozs/common/utils/HttpClientUtil.java

@@ -99,6 +99,15 @@ public class HttpClientUtil {
         return String.valueOf(response.code());
     }
 
+    public static String gets(String url) throws Exception {
+        Request request = new Request.Builder()
+                .url(url)
+                .get()
+                .build();
+        Response response = client.newCall(request).execute();
+        return response.body() != null ? response.body().string() : null;
+    }
+
     public static InputStream download(String url) throws Exception {
         Request request = new Request.Builder().url(url).build();
         ResponseBody body = client.newCall(request).execute().body();