潘志宝
2025-03-12 fcc5791b5d0d03e346896800fbbc51994a93a32a
iailab-plat-sdk/src/main/java/com/iailab/sdk/util/http/IailabHttpUtils.java
@@ -1,7 +1,7 @@
package com.iailab.sdk.util.http;
import com.iailab.sdk.auth.client.IailabAuthClient;
import com.iailab.sdk.auth.config.AuthProperties;
import com.iailab.sdk.auth.config.SdkAutoConfiguration;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
@@ -17,12 +17,6 @@
public class IailabHttpUtils {
    private static AuthProperties authProperties;
    public static void setAuthProperties(AuthProperties properties) {
        authProperties = properties;
    }
    /**
     *
@@ -61,7 +55,7 @@
            httpGet.addHeader("Accept", "application/json");
            httpGet.addHeader("Content-Type", "application/json;charset=UTF-8");
            httpGet.addHeader("Authorization", "Bearer " + IailabAuthClient.accessToken);
            httpGet.addHeader("Tenant-Id", String.valueOf(authProperties.getTenantId()));
            httpGet.addHeader("Tenant-Id", SdkAutoConfiguration.TENANT_ID.toString());
            HttpResponse response = httpClient.execute(httpGet);
            if (response != null) {
                HttpEntity resEntity = response.getEntity();
@@ -95,7 +89,7 @@
            httpPost.addHeader("Accept", "application/json");
            httpPost.addHeader("Content-Type", "application/json;charset=UTF-8");
            httpPost.addHeader("Authorization", "Bearer " + IailabAuthClient.accessToken);
            httpPost.addHeader("Tenant-Id", String.valueOf(authProperties.getTenantId()));
            httpPost.addHeader("Tenant-Id", SdkAutoConfiguration.TENANT_ID.toString());
            StringEntity stringEntity = new StringEntity(json);
            stringEntity.setContentEncoding("UTF-8");
            stringEntity.setContentType("application/json");