Tabnine Logo
Https
Code IndexAdd Tabnine to your IDE (free)

How to use
Https
in
me.hao0.common.http

Best Java code snippets using me.hao0.common.http.Https (Showing top 14 results out of 315)

origin: me.hao0/common

public static Https post(String url){
  return post(url, true);
}
origin: ihaolin/common

public static Https get(String url, Boolean encode){
  Https https = new Https();
  https.connection = createConnection(url, "GET", encode);
  return https;
}
origin: me.hao0/common

/**
 * 获取请求响应内容
 * @return 响应内容
 */
public String request(){
  prepareRequest();
  return doRequest();
}
origin: ihaolin/wepay

protected <T> T doHttpsPost(final String url, final Map<String, String> params, Class<T> respClazz){
  String requestBody = Maps.toXml(params);
  String resp = Https.post(url).body(requestBody)
      .ssLSocketFactory(wepay.getSslSocketFactory()).request();
  Map<String, Object> respMap = toMap(resp.replaceAll("(\\r|\\n)", ""));
  if (!doVerifySign(respMap)){
    throw new SignException("微信响应内容签名非法: " + respMap);
  }
  return Jsons.DEFAULT.fromJson(Jsons.DEFAULT.toJson(respMap), respClazz);
}
origin: me.hao0/common

public static Https get(String url){
  return get(url, true);
}
origin: me.hao0/common

private void prepareRequest() {
  connection.setDoInput(true);
  connection.setDoOutput(true);
  connection.setConnectTimeout(connectTimeout);
  connection.setReadTimeout(readTimeout);
  header("Accept-Charset", acceptCharset);
  header("Connection", connectType);
  if (gzip){
    header("Accept-Encoding", "gzip, deflate");
  }
  if (!Strings.isNullOrEmpty(contentType)){
    header("Content-Type", connectType);
  }
  if (!Strings.isNullOrEmpty(acceptType)){
    header("Accept", acceptType);
  }
  if (!Strings.isNullOrEmpty(body)){
    header("Content-Length", String.valueOf(body.length()));
  }
}
origin: me.hao0/wepay-core

protected <T> T doHttpsPost(final String url, final Map<String, String> params, Class<T> respClazz){
  String requestBody = Maps.toXml(params);
  String resp = Https.post(url).body(requestBody)
      .ssLSocketFactory(wepay.getSslSocketFactory()).request();
  Map<String, Object> respMap = toMap(resp.replaceAll("(\\r|\\n)", ""));
  if (!doVerifySign(respMap)){
    throw new SignException("微信响应内容签名非法: " + respMap);
  }
  return Jsons.DEFAULT.fromJson(Jsons.DEFAULT.toJson(respMap), respClazz);
}
origin: ihaolin/common

public static Https get(String url){
  return get(url, true);
}
origin: ihaolin/common

private void prepareRequest() {
  connection.setDoInput(true);
  connection.setDoOutput(true);
  connection.setConnectTimeout(connectTimeout);
  connection.setReadTimeout(readTimeout);
  header("Accept-Charset", acceptCharset);
  header("Connection", connectType);
  if (gzip){
    header("Accept-Encoding", "gzip, deflate");
  }
  if (!Strings.isNullOrEmpty(contentType)){
    header("Content-Type", connectType);
  }
  if (!Strings.isNullOrEmpty(acceptType)){
    header("Accept", acceptType);
  }
  if (!Strings.isNullOrEmpty(body)){
    header("Content-Length", String.valueOf(body.length()));
  }
}
origin: me.hao0/common

public static Https get(String url, Boolean encode){
  Https https = new Https();
  https.connection = createConnection(url, "GET", encode);
  return https;
}
origin: ihaolin/common

/**
 * 获取请求响应内容
 * @return 响应内容
 */
public String request(){
  prepareRequest();
  return doRequest();
}
origin: ihaolin/common

public static Https post(String url){
  return post(url, true);
}
origin: ihaolin/common

public static Https post(String url, Boolean encode){
  Https https = new Https();
  https.connection = createConnection(url, "POST", encode);
  return https;
}
origin: me.hao0/common

public static Https post(String url, Boolean encode){
  Https https = new Https();
  https.connection = createConnection(url, "POST", encode);
  return https;
}
me.hao0.common.httpHttps

Javadoc

简单的Https请求工具 Author: haolin Email: haolin.h0@gmail.com Date: 1/12/15

Most used methods

  • post
  • <init>
  • body
    设置request body
  • createConnection
  • doRequest
  • get
  • header
    设置请求header
  • prepareRequest
  • request
    获取请求响应内容
  • ssLSocketFactory
    设置SSLSocketFactory

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (ScheduledExecutorService)
  • compareTo (BigDecimal)
  • setRequestProperty (URLConnection)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JTable (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now