程序包 com.sh.util
类 HttpUtilBuilder
java.lang.Object
com.sh.util.HttpUtilBuilder
Description: HttpUtil工具扩展类
Title:首亨软件 - 聚天平台
-
嵌套类概要
嵌套类 -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明acceptEvent(Consumer<String> eventConsumer) 支持SSEacceptEvent(Consumer<String> eventConsumer, boolean convertUnicode) 支持SSEaddAuthorizationBearer(String token) addHeader_ContentType(String value) addHeader_UserAgent(String value) 添加参数添加参数addParamNoEncode(String name, String value) connectTimeout(int timeout, TimeUnit time) connectTimeoutMilliseconds(int timeout) connectTimeoutSeconds(int timeout) static HttpUtilBuilderdeleteWithJson(String url) getParam()getWithJson(String url) getWithJson(String[] url) onConnected(Consumer<HttpURLConnection> eventConnectedConsumer) 连接后事件outCharset(String charset) postWithJson(String url) postWithJson(String[] url) putWithJson(String url) readTimeout(int timeout, TimeUnit time) readTimeoutMilliseconds(int timeout) readTimeoutSeconds(int timeout) timeoutSeconds(int timeout)
-
字段详细资料
-
eventConnectedConsumer
-
-
构造器详细资料
-
HttpUtilBuilder
public HttpUtilBuilder()
-
-
方法详细资料
-
createBuilder
-
inCharset
-
outCharset
-
charset
-
timeout
-
timeoutSeconds
-
connectTimeoutMilliseconds
-
connectTimeoutSeconds
-
connectTimeout
-
readTimeoutSeconds
-
readTimeoutMilliseconds
-
readTimeout
-
addHeader
-
acceptEvent
支持SSE- 返回:
-
acceptEvent
支持SSE- 参数:
eventConsumer- 事件消息convertUnicode- 是否将unicode转换为字符串,一般大模型返回时为unicode值- 返回:
-
onConnected
连接后事件- 参数:
eventConnectedConsumer-- 返回:
HttpUtilBuilder
-
addHeader_UserAgent
-
addHeader_UserAgent
-
addHeader_ContentType
-
addHeader_ContentType_json
-
addAuthorizationBearer
-
addParam
添加参数- 参数:
name- 参数名称value- 参数值,如果非字母或数字,将自动进行编码- 返回:
-
addParam
-
addParam
添加参数- 参数:
name- 参数名称value- 参数值encode- 是否编码,为true时,只有包含中文的才会编码- 返回:
-
addParamNoEncode
-
addParam
-
addRaw
-
addBody
-
post
-
post
-
post2
-
postWithJson
-
postWithJson
-
get2
-
get
-
get
-
getWithJson
-
getWithJson
-
put
-
put2
-
putWithJson
-
delete
-
delete2
-
deleteWithJson
-
getParam
-