public class JdkHttpUtils extends AbstractHttpUtils implements HttpUtils
| Modifier and Type | Class and Description |
|---|---|
static class |
JdkHttpUtils.FormBody |
static class |
JdkHttpUtils.FormDataBody |
| Modifier and Type | Field and Description |
|---|---|
protected static JdkHttpDispatcherLoader |
dispatcherLoader |
_charset, _cookies, _enablePrintln, _files, _headers, _multipart, _params, _proxy, _serializer, _sslSupplier, _timeout, _url| Constructor and Description |
|---|
JdkHttpUtils(String url) |
| Modifier and Type | Method and Description |
|---|---|
static void |
allowMethods(String... methods)
补丁,增加新方法支持
|
static void |
allowPatch()
允许 PATCH 方法
|
HttpUtils |
body(byte[] bytes,
String contentType)
主体配置
|
HttpUtils |
body(InputStream raw,
String contentType)
主体配置
|
HttpUtils |
body(String txt,
String contentType)
设置 BODY txt 及内容类型
|
HttpUtils |
bodyOfBean(Object obj)
主体配置(由序列化器决定内容类型)
|
protected HttpResponse |
execDo(String _method,
CompletableFuture<HttpResponse> future) |
protected HttpURLConnection |
getClient(String newUrl) |
protected HttpResponse |
getResponse(HttpURLConnection _builder,
String method) |
protected HttpURLConnection |
openConnection(String newUrl) |
protected HttpResponse |
request(HttpURLConnection _builder,
String method) |
protected String |
urlRebuild(String method,
String url,
Charset charset) |
charset, charset, cookie, cookieAdd, cookies, cookies, data, data, data, data, data, delete, deleteAs, enablePrintln, exec, execAsBody, execAsBody, execAsCode, execAsLineStream, execAsSseStream, execAsync, get, getAs, getLocationUrl, getRequestCookieString, head, header, headerAdd, headers, headers, isRedirected, multipart, options, patch, patchAs, post, postAs, proxy, put, putAs, serializer, serializer, ssl, timeout, tryInitCookies, tryInitFiles, tryInitHeaders, tryInitParams, userAgentclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaccept, body, body, bodyJson, bodyOfJson, bodyOfTxt, bodyRaw, bodyRaw, bodyRaw, bodyRaw, bodyTxt, bodyTxt, charset, contentType, cookie, cookieAdd, cookies, cookies, data, data, data, data, data, data, delete, deleteAs, enablePrintln, exec, execAsBody, execAsBody, execAsCode, execAsEventStream, execAsLineStream, execAsSseStream, execAsTextStream, execAsync, fill, get, getAs, head, header, headerAdd, headers, headers, http, http, http, multipart, options, patch, patchAs, post, post, postAs, postAs, proxy, proxy, put, putAs, serializer, serializer, ssl, timeout, timeout, timeout, toQueryString, toQueryString, urlEncode, urlEncode, userAgentprotected static final JdkHttpDispatcherLoader dispatcherLoader
public JdkHttpUtils(String url)
public HttpUtils bodyOfBean(Object obj) throws HttpException
HttpUtilsbodyOfBean in interface HttpUtilsHttpExceptionpublic HttpUtils body(byte[] bytes, String contentType)
HttpUtilspublic HttpUtils body(InputStream raw, String contentType)
HttpUtilsprotected HttpResponse execDo(String _method, CompletableFuture<HttpResponse> future) throws IOException
execDo in class AbstractHttpUtilsIOExceptionprotected HttpURLConnection getClient(String newUrl) throws IOException
IOExceptionprotected HttpURLConnection openConnection(String newUrl) throws IOException
IOExceptionprotected HttpResponse request(HttpURLConnection _builder, String method) throws IOException
IOExceptionprotected HttpResponse getResponse(HttpURLConnection _builder, String method) throws IOException
IOExceptionprotected String urlRebuild(String method, String url, Charset charset) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic static void allowPatch()
public static void allowMethods(String... methods)
Copyright © 2025. All rights reserved.