类 HttpUtils

java.lang.Object
com.walker.remote.util.HttpUtils

public class HttpUtils extends Object
  • 方法详细资料

    • getInstance

      public static HttpUtils getInstance()
    • getHttpClient

      public org.apache.hc.client5.http.classic.HttpClient getHttpClient()
    • getHttpClientWithCookie

      public org.apache.hc.client5.http.classic.HttpClient getHttpClientWithCookie(org.apache.hc.client5.http.cookie.CookieStore cookieStore)
      返回设置过cookie的httpClient对象,每次都要新创建
      参数:
      cookieStore -
      返回:
    • getHttpDoubleTrustClient

      public org.apache.hc.client5.http.classic.HttpClient getHttpDoubleTrustClient(DoubleTrust doubleTrust, org.apache.hc.client5.http.cookie.CookieStore cookieStore)
      返回一个双向认证的HttpClient对象。

      注意:在上层应用中,该方法通常被初始化调用,而不是每次使用都被频繁获取。
      参数:
      doubleTrust -
      返回:
    • doTranslatePairs

      public static List<org.apache.hc.core5.http.NameValuePair> doTranslatePairs(Map<String,String> simpleData)
    • doTranslatePairs

      public static List<org.apache.hc.core5.http.NameValuePair> doTranslatePairs(String json)
      把json格式参数转换为特定http参数
      参数:
      json -
      返回:
    • getNewRemoteAccessor

      public RemoteAccessor getNewRemoteAccessor(String remoteURL, AbstractByteCoder contentCoder, DoubleTrust doubleTrust)
      返回一个通用的远程访问对象
      参数:
      contentCoder -
      返回: