net.vsame.url2sql.utils
类 HttpsUtils

java.lang.Object
  继承者 net.vsame.url2sql.utils.HttpsUtils

public class HttpsUtils
extends Object

Http 访问工具类

作者:
gaolei

嵌套类摘要
static class HttpsUtils.MyX509TrustManager
          证书信任管理器(用于https请求)
 
构造方法摘要
HttpsUtils()
           
 
方法摘要
static String encodeParams(String... params)
           
static String get(String url, Charset charset, String... params)
          GET请求 默认是 utf-8 编码 get("http://xxx.com/search", "a=bcd", "b=xxx");
static String get(String url, String... params)
          GET请求 默认是 utf-8 编码 get("http://xxx.com/search", "a=bcd", "b=xxx");
static void main(String[] args)
           
static String post(String url, Charset charset, String... params)
          POST请求 默认是 utf-8 编码 post("http://xxx.com/search", "a=bcd", "b=xxx");
static String post(String url, List<PostParam> params, String charset)
           
static String post(String url, String... params)
          POST请求 默认是 utf-8 编码 post("http://xxx.com/search", "a=bcd", "b=xxx");
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

HttpsUtils

public HttpsUtils()
方法详细信息

get

public static String get(String url,
                         String... params)
GET请求 默认是 utf-8 编码 get("http://xxx.com/search", "a=bcd", "b=xxx");

参数:
url -
params - 请单个编写,内部会自动将等号后字符编码
返回:

get

public static String get(String url,
                         Charset charset,
                         String... params)
GET请求 默认是 utf-8 编码 get("http://xxx.com/search", "a=bcd", "b=xxx");

参数:
url -
charset -
params - 请单个编写,内部会自动将等号后字符编码
返回:

post

public static String post(String url,
                          String... params)
POST请求 默认是 utf-8 编码 post("http://xxx.com/search", "a=bcd", "b=xxx");

参数:
url -
params - 请单个编写,内部会自动将等号后字符编码
返回:

post

public static String post(String url,
                          Charset charset,
                          String... params)
POST请求 默认是 utf-8 编码 post("http://xxx.com/search", "a=bcd", "b=xxx");

参数:
url -
params - 请单个编写,内部会自动将等号后字符编码
返回:

post

public static String post(String url,
                          List<PostParam> params,
                          String charset)

encodeParams

public static String encodeParams(String... params)

main

public static void main(String[] args)


Copyright © 2015. All Rights Reserved.