类 Base
- java.lang.Object
-
- com.ajaxjs.util.http_request.Base
-
-
构造器概要
构造器 构造器 说明 Base()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static ResponseEntity
connect(String url, String method, Consumer<HttpURLConnection> fn)
联合以上两个方法static ResponseEntity
connect(HttpURLConnection conn)
发送请求,返回响应信息static HttpURLConnection
initHttpConnection(String url, String method)
HttpURLConnection 工厂函数,对输入的网址进行初始化
-
-
-
方法详细资料
-
initHttpConnection
public static HttpURLConnection initHttpConnection(String url, String method)
HttpURLConnection 工厂函数,对输入的网址进行初始化- 参数:
url
- 请求目的地址method
- 请求方法- 返回:
- 请求连接对象
-
connect
public static ResponseEntity connect(HttpURLConnection conn)
发送请求,返回响应信息- 参数:
conn
- 请求连接对象- 返回:
- 返回类型
-
connect
public static ResponseEntity connect(String url, String method, Consumer<HttpURLConnection> fn)
联合以上两个方法- 参数:
url
- 请求目的地址method
- 请求方法fn
- 自定义 HTTP 头的时候可设置,可选的- 返回:
- 响应结果
-
-