一、java调用方式 package com.credithc.rc.kg.csdata.Utils; import org.apache.commons.codec.binary.Base64; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.params.CoreConnectionPNames; import org.apache.http.ssl.SSLContextBuilder; import org.apache.http.util.EntityUtils; import javax.net.ssl.SSLContext; import java.util.Map; public class HttpsUtils { public static String createFeature(String json,String surl,String up) { String plainCredentials = up;//"lucy:12345"; String url = surl;//"http://127.0.0.1:9090/feature"; String base64Credentials = new String(Base64.encodeBase64(plainCredentials.getBytes())); String responseString = ""; Map resultMap = null; try { SSLContext sslContext = new SSLContextBui
带Basec用户验证的接口的java与python调用方式
最新推荐文章于 2023-11-06 11:13:22 发布