wxr
2023-01-03 0fd690cf61ce8b954cd742fb790cd8c3cce18d6d
AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpClient.java
@@ -25,6 +25,13 @@
public class HttpClient {
    private static final String TAG=HttpClient.class.getSimpleName();
    private static boolean showErrorInfo = false;
    public static void SetShowErrorInfo(boolean isShow){
        showErrorInfo = isShow;
    }
    /**
     * post
     *
@@ -35,7 +42,7 @@
     * @return
     */
    public static String post(String urlStr, String paramStr, String contentType, String debugTag,int timeOut) throws IOException {
        LogUtil.debugLog(TAG,urlStr+"..."+paramStr);
        LogUtil.debugLog(TAG,urlStr+"..debuglogHdlkaede.."+paramStr);
        HttpsURLConnection conn = null;
        String resultData = "";
        OutputStream outputStream = null;
@@ -76,8 +83,11 @@
                baos.flush();
                if (debugTag != null)
                    LogUtil.debugLog(debugTag, "request data " + resultData);
            } else
                throw new IOException(String.format("http_get failed: status=%d", responseCode));
            } else {
                if(showErrorInfo) {
                    throw new IOException(String.format("http_get failed: status=%d : url=%d", responseCode,urlStr));
                }
            }
        } catch (IOException e) {
            throw e;
        } catch (Throwable e) {