类的使用
com.dtflys.forest.http.ForestRequest
使用ForestRequest的程序包
程序包
说明
-
com.dtflys.forest中ForestRequest的使用
修饰符和类型方法说明static ForestRequest<?>创建 DELETE 请求的ForestRequest对象static ForestRequest<?>创建 GET 请求的ForestRequest对象static ForestRequest<?>创建 HEAD 请求的ForestRequest对象static ForestRequest<?>创建 OPTIONS 请求的ForestRequest对象static ForestRequest<?>创建 PATCH 请求的ForestRequest对象static ForestRequest<?>创建 POST 请求的ForestRequest对象static ForestRequest<?>创建 PUT 请求的ForestRequest对象static ForestRequest<?>Forest.request()创建通用ForestRequest对象static <R> ForestRequest<R>创建通用ForestRequest对象ForestGenericClient.request()获取 Forest 通用请求<T> ForestRequest<T>获取 Forest 通用请求static ForestRequest<?>创建 TRACE 请求的ForestRequest对象 -
com.dtflys.forest.auth中ForestRequest的使用
参数类型为ForestRequest的com.dtflys.forest.auth中的方法修饰符和类型方法说明voidBasicAuth.enhanceAuthorization(ForestRequest request) voidForestAuthenticator.enhanceAuthorization(ForestRequest request) 增强请求的认证信息 -
com.dtflys.forest.backend中ForestRequest的使用
修饰符和类型字段说明protected final ForestRequestAbstractHttpExecutor.requestprotected final ForestRequestResponseHandler.request修饰符和类型方法说明AbstractHttpExecutor.getRequest()AsyncHttpExecutor.getRequest()HttpExecutor.getRequest()参数类型为ForestRequest的com.dtflys.forest.backend中的方法修饰符和类型方法说明voidBodyBuilder.buildBody(R req, ForestRequest request, LifeCycleHandler lifeCycleHandler) AbstractHttpBackend.createAsyncExecutor(ForestConnectionManager connectionManager, ForestRequest request, LifeCycleHandler lifeCycleHandler) AbstractHttpBackend.createExecutor(ForestRequest request, LifeCycleHandler lifeCycleHandler) HttpBackend.createExecutor(ForestRequest request, LifeCycleHandler lifeCycleHandler) 创建HTTP执行器HttpBackend.HttpExecutorCreator.createExecutor(ForestConnectionManager connectionManager, ForestRequest request, LifeCycleHandler lifeCycleHandler) 创建HTTP执行器AbstractHttpBackend.createKotlinCoroutineExecutor(ForestConnectionManager connectionManager, ForestRequest request, LifeCycleHandler lifeCycleHandler) abstract HttpExecutorAbstractHttpBackend.createSyncExecutor(ForestConnectionManager connectionManager, ForestRequest request, LifeCycleHandler lifeCycleHandler) BackendClientProvider.getClient(ForestRequest request, LifeCycleHandler lifeCycleHandler) abstract voidResponseHandler.handleFuture(ForestRequest request, Future<R> httpResponseFuture) 参数类型为ForestRequest的com.dtflys.forest.backend中的构造器限定符构造器说明AbstractHttpExecutor(ForestRequest request, HttpclientRequestSender requestSender) ResponseHandler(ForestRequest request, LifeCycleHandler lifeCycleHandler) -
com.dtflys.forest.backend.body中ForestRequest的使用
修饰符和类型方法说明voidAbstractBodyBuilder.buildBody(T httpRequest, ForestRequest request, LifeCycleHandler lifeCycleHandler) 构建请求体protected abstract voidAbstractBodyBuilder.setBinaryBody(T httpReq, ForestRequest request, String charset, String contentType, byte[] bytes, boolean mergeCharset) 设置二进制请求体voidAbstractBodyBuilder.setBody(T httpReq, ForestRequest request, byte[] bytes, String charset, String contentType, boolean mergeCharset) protected abstract voidAbstractBodyBuilder.setFileBody(T httpReq, ForestRequest request, Charset charset, String contentType, LifeCycleHandler lifeCycleHandler) 设置文件请求体protected abstract voidAbstractBodyBuilder.setStringBody(T httpReq, ForestRequest request, String text, String charset, String contentType, boolean mergeCharset) 设置字符串请求体 -
com.dtflys.forest.backend.httpclient中ForestRequest的使用
修饰符和类型方法说明HttpclientBackend.createSyncExecutor(ForestConnectionManager connectionManager, ForestRequest request, LifeCycleHandler lifeCycleHandler) voidHttpClientLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) -
com.dtflys.forest.backend.httpclient.body中ForestRequest的使用
修饰符和类型方法说明protected voidHttpclientBodyBuilder.setBinaryBody(T httpReq, ForestRequest request, String charset, String contentType, byte[] bytes, boolean mergeCharset) protected voidHttpclientBodyBuilder.setFileBody(T httpReq, ForestRequest request, Charset charset, String contentType, LifeCycleHandler lifeCycleHandler) protected voidHttpclientBodyBuilder.setStringBody(T httpReq, ForestRequest request, String text, String charset, String contentType, boolean mergeCharset) 限定符构造器说明HttpclientMultipartCommonBody(ForestRequest request, ForestMultipart multipart, org.apache.http.entity.ContentType contentType, String filename, LifeCycleHandler handler) HttpclientMultipartFileBody(ForestRequest request, File file, org.apache.http.entity.ContentType contentType, String filename, LifeCycleHandler handler) -
com.dtflys.forest.backend.httpclient.conn中ForestRequest的使用
修饰符和类型方法说明static ForestRequest<?>HttpContextUtils.getCurrentRequest(org.apache.http.protocol.HttpContext context) 修饰符和类型方法说明org.apache.http.client.HttpClientHttpclientConnectionManager.DefaultHttpClientProvider.getClient(ForestRequest request, LifeCycleHandler lifeCycleHandler) org.apache.http.client.HttpClientHttpclientConnectionManager.getHttpClient(ForestRequest request, LifeCycleHandler lifeCycleHandler) -
com.dtflys.forest.backend.httpclient.executor中ForestRequest的使用
限定符构造器说明HttpclientExecutor(ForestRequest request, HttpclientResponseHandler httpclientResponseHandler, HttpclientRequestSender requestSender) -
com.dtflys.forest.backend.httpclient.request中ForestRequest的使用
修饰符和类型方法说明voidHttpclientRequestSender.sendRequest(ForestRequest request, AbstractHttpExecutor executor, HttpclientResponseHandler responseHandler, org.apache.http.client.methods.HttpUriRequest httpRequest, LifeCycleHandler lifeCycleHandler, Date startDate) voidSyncHttpclientRequestSender.sendRequest(ForestRequest request, AbstractHttpExecutor executor, HttpclientResponseHandler responseHandler, org.apache.http.client.methods.HttpUriRequest httpRequest, LifeCycleHandler lifeCycleHandler, Date startDate) 限定符构造器说明AbstractHttpclientRequestSender(HttpclientConnectionManager connectionManager, ForestRequest request) SyncHttpclientRequestSender(HttpclientConnectionManager connectionManager, ForestRequest request) -
com.dtflys.forest.backend.httpclient.response中ForestRequest的使用
修饰符和类型方法说明HttpclientForestResponseFactory.createResponse(ForestRequest<?> request, org.apache.http.HttpResponse httpResponse, LifeCycleHandler lifeCycleHandler, Throwable exception, Date requestTime) voidHttpclientResponseHandler.handleFuture(ForestRequest request, Future httpResponseFuture) 限定符构造器说明HttpclientEntity(ForestRequest request, org.apache.http.HttpEntity entity, LifeCycleHandler handler) HttpclientForestFuture(ForestRequest request, Date requestTime, Class<T> innerType, LifeCycleHandler lifeCycleHandler, Future<R> httpResponseFuture, ForestResponseFactory forestResponseFactory) HttpclientForestResponse(ForestRequest request, org.apache.http.HttpResponse httpResponse, org.apache.http.HttpEntity entity, Date requestTime, Date responseTime) HttpclientResponseHandler(ForestRequest request, LifeCycleHandler lifeCycleHandler) -
com.dtflys.forest.backend.okhttp3中ForestRequest的使用
修饰符和类型方法说明OkHttp3Backend.createSyncExecutor(ForestConnectionManager connectionManager, ForestRequest request, LifeCycleHandler lifeCycleHandler) voidOkHttp3LifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) -
com.dtflys.forest.backend.okhttp3.body中ForestRequest的使用
修饰符和类型方法说明protected voidOkHttp3BodyBuilder.setBinaryBody(okhttp3.Request.Builder builder, ForestRequest request, String charset, String contentType, byte[] bytes, boolean mergeCharset) protected voidOkHttp3BodyBuilder.setFileBody(okhttp3.Request.Builder builder, ForestRequest request, Charset charset, String contentType, LifeCycleHandler lifeCycleHandler) protected voidOkHttp3BodyBuilder.setStringBody(okhttp3.Request.Builder builder, ForestRequest request, String text, String charset, String contentType, boolean mergeCharset) 限定符构造器说明OkHttpMultipartBody(ForestRequest request, okhttp3.RequestBody requestBody, LifeCycleHandler handler) -
com.dtflys.forest.backend.okhttp3.conn中ForestRequest的使用
修饰符和类型方法说明okhttp3.OkHttpClientOkHttp3ConnectionManager.DefaultOkHttpClientProvider.getClient(ForestRequest request, LifeCycleHandler lifeCycleHandler) okhttp3.OkHttpClientOkHttp3ConnectionManager.getClient(ForestRequest request, LifeCycleHandler lifeCycleHandler) OkHttp3ConnectionManager.getX509TrustManager(ForestRequest request) -
com.dtflys.forest.backend.okhttp3.executor中ForestRequest的使用
修饰符和类型方法说明protected okhttp3.OkHttpClientOkHttp3Executor.getClient(ForestRequest request, LifeCycleHandler lifeCycleHandler) 限定符构造器说明OkHttp3Executor(ForestRequest request, OkHttp3ConnectionManager connectionManager, OkHttp3ResponseHandler okHttp3ResponseHandler) -
com.dtflys.forest.backend.okhttp3.response中ForestRequest的使用
修饰符和类型方法说明OkHttp3ForestResponseFactory.createResponse(ForestRequest<?> request, okhttp3.Response res, LifeCycleHandler lifeCycleHandler, Throwable exception, Date requestTime) voidOkHttp3ResponseHandler.handleFuture(ForestRequest request, Future<Object> httpResponseFuture) 限定符构造器说明OkHttp3ForestResponse(ForestRequest request, okhttp3.Response okResponse, Date requestTime, Date responseTime) OkHttp3ResponseHandler(ForestRequest request, LifeCycleHandler lifeCycleHandler) OkHttpResponseBody(ForestRequest request, okhttp3.ResponseBody responseBody, LifeCycleHandler handler) -
com.dtflys.forest.backend.url中ForestRequest的使用
修饰符和类型方法说明QueryableURLBuilder.buildUrl(ForestRequest request) abstract StringURLBuilder.buildUrl(ForestRequest request) -
com.dtflys.forest.callback中ForestRequest的使用
参数类型为ForestRequest的com.dtflys.forest.callback中的方法修饰符和类型方法说明AddressSource.getAddress(ForestRequest req) 获取地址信息HTTPProxySource.getProxy(ForestRequest req) 获取正向代理信息voidOnCanceled.onCanceled(ForestRequest req, ForestResponse res) 请求取消后调用该方法byte[]OnEncoded.onEncoded(ForestEncoder encoder, byte[] data, ForestRequest req) 在请求体被编码后调用voidOnError.onError(ForestRuntimeException ex, ForestRequest req, ForestResponse res) 请求失败后调用该方法voidOnLoadCookie.onLoadCookie(ForestRequest req, ForestCookies cookies) 在发送请求加载Cookie时调用该方法voidOnRedirection.onRedirection(ForestRequest<?> redirectReq, ForestRequest<?> prevReq, ForestResponse<?> prevRes) 回调函数:在请求重定向时触发voidOnRetry.onRetry(ForestRequest req, ForestResponse res) 回调函数: 在触发请求重试时执行voidOnSaveCookie.onSaveCookie(ForestRequest req, ForestCookies cookies) 在请求响应成功后,需要保存Cookie时调用该方法voidOnSuccess.onSuccess(T data, ForestRequest req, ForestResponse res) 请求成功后调用该方法booleanDefaultRetryWhen.retryWhen(ForestRequest request, ForestResponse response) booleanRetryWhen.retryWhen(ForestRequest req, ForestResponse res) 回调函数: 是否触发重试booleanDefaultSuccessWhen.successWhen(ForestRequest req, ForestResponse res) booleanSuccessWhen.successWhen(ForestRequest req, ForestResponse res) 回调函数: 请求是否成功 -
com.dtflys.forest.config中ForestRequest的使用
修饰符和类型方法说明创建 DELETE 请求的ForestRequest对象创建 GET 请求的ForestRequest对象创建 HEAD 请求的ForestRequest对象创建 OPTIONS 请求的ForestRequest对象创建 PATCH 请求的ForestRequest对象创建 POST 请求的ForestRequest对象创建 PUT 请求的ForestRequest对象ForestConfiguration.request()创建通用ForestRequest对象<R> ForestRequest<R>创建通用ForestRequest对象创建 TRACE 请求的ForestRequest对象 -
com.dtflys.forest.converter中ForestRequest的使用
参数类型为ForestRequest的com.dtflys.forest.converter中的方法修饰符和类型方法说明default byte[]ForestEncoder.encodeRequestBody(ForestRequest request, Charset charset) default byte[]ForestEncoder.encodeRequestBody(ForestRequest request, Charset charset, ConvertOptions options) ConvertOptions.getValue(Object value, ForestRequest request) -
com.dtflys.forest.converter.binary中ForestRequest的使用
修饰符和类型方法说明byte[]DefaultBinaryConverter.encodeRequestBody(ForestRequest request, Charset charset) -
com.dtflys.forest.converter.form中ForestRequest的使用
修饰符和类型方法说明protected List<RequestNameValue>DefaultFormConvertor.processFromNameValueList(ForestRequest request, List<RequestNameValue> nameValueList, ForestConfiguration configuration, ConvertOptions options) 处理Form表单中的键值对列表 -
com.dtflys.forest.converter.json中ForestRequest的使用
修饰符和类型方法说明ForestFastjson2Converter.convertObjectToMap(Object obj, ForestRequest request, ConvertOptions options) ForestFastjsonConverter.convertObjectToMap(Object obj, ForestRequest request, ConvertOptions options) ForestGsonConverter.convertObjectToMap(Object obj, ForestRequest request, ConvertOptions options) ForestJacksonConverter.convertObjectToMap(Object obj, ForestRequest request, ConvertOptions options) ForestJsonConverter.convertObjectToMap(Object obj, ForestRequest request) 将源对象转换为Map对象ForestJsonConverter.convertObjectToMap(Object obj, ForestRequest request, ConvertOptions options) 将源对象转换为Map对象 -
com.dtflys.forest.exceptions中ForestRequest的使用
修饰符和类型方法说明ForestHandlerException.getRequest()ForestPoolException.getRequest()ForestRetryException.getRequest()修饰符和类型方法说明voidForestHandlerException.setRequest(ForestRequest request) voidForestPoolException.setRequest(ForestRequest request) 参数类型为ForestRequest的com.dtflys.forest.exceptions中的构造器限定符构造器说明ForestAbortException(ForestRequest request, ForestRequestPool pool) ForestHandlerException(String message, ForestRequest request, ForestResponse response) ForestHandlerException(String message, Throwable cause, ForestRequest request, ForestResponse response) ForestHandlerException(Throwable cause, ForestRequest request, ForestResponse response) ForestPoolException(ForestRequest request, String message) ForestRetryException(ForestRequest request, int maxRetryCount, int currentRetryCount) ForestRetryException(ForestRequest request, int maxRetryCount, int currentRetryCount, boolean needRetry) ForestRetryException(Throwable cause, ForestRequest request, int maxRetryCount, int currentRetryCount) -
com.dtflys.forest.handler中ForestRequest的使用
参数类型为ForestRequest的com.dtflys.forest.handler中的方法修饰符和类型方法说明ResultHandler.getResult(ForestRequest request, ForestResponse response, Class resultClass) 进行转换并获取结果ResultHandler.getResult(ForestRequest request, ForestResponse response, Type resultType) 进行转换并获取结果ResultHandler.getResult(ForestRequest request, ForestResponse response, Type resultType, Class resultClass) byte[]LifeCycleHandler.handleBodyEncode(ForestRequest request, ForestEncoder encoder, byte[] encodedData) voidLifeCycleHandler.handleCanceled(ForestRequest request, ForestResponse response) LifeCycleHandler.handleError(ForestRequest request, ForestResponse response) LifeCycleHandler.handleError(ForestRequest request, ForestResponse response, Throwable ex) LifeCycleHandler.handleFuture(ForestRequest request, Future resultData) voidLifeCycleHandler.handleInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) voidLifeCycleHandler.handleLoadCookie(ForestRequest request, ForestCookies cookies) voidLifeCycleHandler.handleProgress(ForestRequest request, ForestProgress progress) LifeCycleHandler.handleResultType(ForestRequest request, ForestResponse response) LifeCycleHandler.handleResultType(ForestRequest request, ForestResponse response, Type resultType, Class resultClass) voidLifeCycleHandler.handleSaveCookie(ForestRequest request, ForestCookies cookies) voidLifeCycleHandler.handleSuccess(Object resultData, ForestRequest request, ForestResponse response) LifeCycleHandler.handleSync(ForestRequest request, ForestResponse response) LifeCycleHandler.handleSyncWithException(ForestRequest request, ForestResponse response, Throwable ex) -
com.dtflys.forest.http中ForestRequest的使用
修饰符和类型字段说明protected ForestRequestForestResponse.request请求对象protected final ForestRequestResultGetter.request修饰符和类型方法说明ForestRequest.addAllQuery(ForestQueryMap queries) 批量添加请求中的Query参数ForestRequest.addArrayQuery(String name, Object... array) 添加请求中的数组类Query参数 (带数组方括号[]的 Query 参数名)ForestRequest.addArrayQuery(String name, Object[] array, boolean isUrlEncode, String charset) 添加请求中的数组类Query参数 (带数组方括号[]的 Query 参数名)ForestRequest.addArrayQuery(String name, Collection collection) 添加请求中的集合类Query参数 (带数组下标的 Query 参数名)ForestRequest.addArrayQuery(String name, Collection collection, boolean isUrlEncode, String charset) 添加请求中的集合类Query参数 (带数组下标的 Query 参数名)ForestRequest.addAttachment(String name, Object value) 添加附件到请求中ForestRequest.addBody(byte[] byteArrayBody) 添加字节数组Body数据ForestRequest.addBody(ForestRequestBody body) 添加Body数据ForestRequest.addBody(RequestNameValue nameValue) 已过时。添加文件Body数据ForestRequest.addBody(InputStream inputStreamBody) 添加输入流Body数据添加输入对象Body数据添加字符串Body数据添加延迟求值的键值对类型Body数据添加键值对类型Body数据添加键值对类型Body数据ForestRequest.addBody(List<RequestNameValue> nameValueList) 已过时。添加 Map 类型 Body 数据ForestRequest.addCookie(ForestCookie cookie) 添加 Cookie 到请求中 (默认严格匹配)ForestRequest.addCookie(ForestCookie cookie, boolean strict) 添加 Cookie 到请求中ForestRequest.addCookies(ForestCookies cookies) 批量添加 Cookie 到请求中ForestRequest.addCookies(List<ForestCookie> cookies) 批量添加 Cookie 到请求中 (默认严格匹配)ForestRequest.addCookies(List<ForestCookie> cookies, boolean strict) 批量添加 Cookie 到请求中ForestRequest.addData(RequestNameValue nameValue) 已过时。已过时。ForestRequest.addData(List<RequestNameValue> data) 已过时。ForestRequest.addFile(ForestMultipart multipart) 添加文件 Multipart添加文件 Multipart添加文件 Multipart添加文件 Multipart添加文件 Multipart添加文件 MultipartForestRequest.addFile(String name, InputStream inputStream, String filename) 添加文件 MultipartForestRequest.addFile(String name, InputStream inputStream, String filename, String contentType) 添加文件 MultipartForestRequest.addFile(List<ForestMultipart> multiparts) 批量添加文件 MultipartForestRequest.addHeader(RequestNameValue nameValue) 添加请求头到该请求中添加延迟求值的请求头到该请求中添加请求头到该请求中通过 Map 批量添加请求头到该请求中ForestRequest.addHeaders(List<RequestNameValue> nameValues) 批量添加请求头到该请求中ForestRequest.addInterceptor(Interceptor interceptor) 添加拦截器到该请求中ForestRequest.addInterceptor(Class<? extends Interceptor> interceptorClass) 添加拦截器到该请求中ForestRequest.addInterceptorAttribute(Class interceptorClass, String attributeName, Object attributeValue) 添加拦截器属性到该请求ForestRequest.addInterceptorAttributes(Class interceptorClass, InterceptorAttributes attributes) 添加拦截器属性到该请求ForestRequest.addJSONQuery(String name, Object value) 添加 JSON Query 参数ForestRequest.addMultipart(ForestMultipart multipart) 添加 MultipartForestRequest.addMultipart(List<ForestMultipart> multiparts) 批量添加 MultipartForestRequest.addNameValue(RequestNameValue nameValue) 添加键值对ForestRequest.addNameValue(List<RequestNameValue> nameValueList) 添加键值对列表ForestRequest.addQuery(SimpleQueryParameter queryParameter) 添加请求中的Query参数ForestRequest.addQuery(SimpleQueryParameter[] queryParameters) 批量添加请求中的Query参数批量添加请求中的Query参数添加请求中延迟求值的Query参数添加请求中的Query参数添加请求中的数组类Query参数 (重复 Query 参数名)添加请求中的数组类Query参数 (重复 Query 参数名)添加请求中的Query参数ForestRequest.addQuery(String name, Collection collection) 添加请求中的集合类Query参数 (重复 Query 参数名)ForestRequest.addQuery(String name, Collection collection, boolean isUrlEncode, String charset) 添加请求中的集合类Query参数 (重复 Query 参数名)ForestRequest.addQuery(Collection<SimpleQueryParameter> queryParameters) 批量添加请求中的Query参数添加 Map 类 Query 参数添加 Map 类 Query 参数ForestRequest.addQueryValues(String name, Collection queryValues) 批量添加请求中的同名Query参数ForestRequest.address(ForestAddress address) 设置请求的主机地址(主机名/ip地址 + 端口号)ForestRequest.address(ForestAddress address, boolean forced) 设置请求的主机地址(主机名/ip地址 + 端口号)设置请求的主机地址(主机名/ip地址 + 端口号)ForestRequest.async()设置为异步ForestRequest.asyncMode(ForestAsyncMode asyncMode) 设置异步请求模式ForestRequest.authenticator(ForestAuthenticator authenticator) 设置请求认证器ForestRequest.autoRedirects(boolean autoRedirects) 设置是否打开自动重定向ForestRequest.backend(HttpBackend backend) 设置HTTP后端框架设置 HTTP 后端框架ForestRequest.backendClient(Object backendClient) 设置 HTTP 后端 Client 对象或对象工厂设置URL根路径ForestRequest.bodyType(ForestDataType bodyType) 设置请求体类型ForestRequest.cacheBackendClient(boolean cacheBackendClient) 设置是否缓存 HTTP 后端 Client 对象设置请求参数编码字符集ForestRequest.clearQueries()删除请求的所有URL查询参数ForestRequest.clearTypeChangeHistory()清空请求类型变更历史列表ForestRequest.clone()克隆Forest请求对象ForestRequest.connectTimeout(int connectTimeout) 设置连接超时时间,时间单位为毫秒ForestRequest.connectTimeout(int connectTimeout, TimeUnit timeUnit) 设置连接超时时间ForestRequest.connectTimeout(Duration connectTimeout) 设置连接超时时间ForestRequest.contentFormUrlEncoded()设置请求头 Content-Type 的值为 application/x-www-form-urlencodedForestRequest.contentType(String contentType) 设置请求头 Content-Type 的值ForestRequest.contentTypeJson()设置请求头 Content-Type 的值为 application/jsonForestRequest.contentTypeMultipartFormData()设置请求头 Content-Type 的值为 multipart/form-dataForestRequest.contentTypeOctetStream()设置请求头 Content-Type 的值为 application/octet-streamForestRequest.contentTypeXml()设置请求头 Content-Type 的值为 application/jsonForestRequest.decoder(ForestConverter decoder) 设置反序列化器ForestRequest.getPrevRequest()获取重定向上一个的请求对象ForestBody.getRequest()ForestQueryMap.getRequest()ForestResponse.getRequest()获取该响应对象对应的请求对象设置URL主机地址ForestRequest.hostnameVerifier(HostnameVerifier hostnameVerifier) 设置SSL主机名/域名验证器ForestRequest.keyStore(SSLKeyStore keyStore) 设置SSL KeyStore信息ForestRequest.maxRetryCount(int retryCount) 设置请求失败后的重试次数ForestRequest.maxRetryInterval(long maxRetryInterval) 设置最大请重试的时间间隔,时间单位为毫秒ForestRequest.methodReturn(T result) 设置该请求对应的方法返回值ForestRequest.onCanceled(OnCanceled onCanceled) 设置OnCanceled回调函数,该回调函数在请求取消后被调用设置OnError回调函数,该回调函数在请求失败时被调用ForestRequest.onLoadCookie(OnLoadCookie onLoadCookie) 设置回调函数: 加载Cookie时调用ForestRequest.onProgress(OnProgress onProgress) 设置进度回调函数:上传/下载进度监听时调用ForestRequest.onRedirection(OnRedirection onRedirection) 设置重定向回调函数: 在请求重定向时触发设置OnRetry回调函数,该回调函数在请求重试时被调用ForestRequest.onSaveCookie(OnSaveCookie onSaveCookie) 设置回调函数: 需要保存Cookie时调用设置OnSuccess回调函数,该回调函数在请求成功时被调用设置URL路径ForestRequest.port(int port) 设置URL主机端口ForestRequest.proxy(ForestProxy proxy) 设置正向代理通过代理 URL 字符串设置正向代理ForestRequest.readTimeout(int readTimeout) 设置读取超时时间,时间单位为毫秒ForestRequest.readTimeout(int readTimeout, TimeUnit timeUnit) 设置读取超时时间ForestRequest.readTimeout(Duration readTimeout) 设置读取超时时间ForestResponse.redirectionRequest()获取重定向Forest请求设置Reference, 即URL井号后面的字符串ForestRequest.removeQuery(String name) 根据查询名删除URL查询参数ForestRequest.replaceBody(ForestRequestBody body) 替换Body数据,原有的Body数据将被清空ForestRequest.replaceBody(String stringbody) 替换Body为新的字符串数据,原有的Body数据将被清空ForestRequest.replaceOrAddQuery(SimpleQueryParameter queryParameter) 替换或添加请求中的Query参数ForestRequest.replaceOrAddQuery(String name, String value) 替换或添加请求中的Query参数ForestRequest.replaceQuery(SimpleQueryParameter queryParameter) 替换请求中的Query参数值ForestRequest.replaceQuery(String name, Object value) 替换请求中的Query参数值ForestRequest.retryer(ForestRetryer retryer) 设置Forest请求重试器ForestRequest.retryer(Class<? extends ForestRetryer> retryerClass) 设置Forest请求重试器设置RetryWhen回调函数, 回调函数为请求重试的触发条件设置RetryWhen回调函数, 回调函数为请求重试的触发条件设置URL地址的HTTP协议头ForestRequest.setAddress(ForestAddress address) 设置请求的主机地址(主机名/ip地址 + 端口号)ForestRequest.setAddress(ForestAddress address, boolean forced) 设置请求的主机地址(主机名/ip地址 + 端口号)ForestRequest.setAddress(String host, int port) 设置请求的主机地址(主机名/ip地址 + 端口号)ForestRequest.setAsync(boolean async) 设置是否异步ForestRequest.setAsyncMode(ForestAsyncMode asyncMode) 设置异步请求模式ForestRequest.setAuthenticator(ForestAuthenticator authenticator) 设置请求认证器ForestRequest.setAutoRedirection(boolean autoRedirection) 设置是否打开自动重定向ForestRequest.setBackend(HttpBackend backend) 设置HTTP后端框架ForestRequest.setBackend(String backendName) 设置HTTP后端框架ForestRequest.setBackendClient(Object backendClient) 设置 HTTP 后端 Client 对象或对象工厂ForestRequest.setBasePath(String path) 设置URL根路径ForestRequest.setBodyType(ForestDataType bodyType) 设置请求体类型ForestRequest.setBoundary(String boundary) 设置 Content-Type 请求头中的 boundary 字符串ForestRequest.setCacheBackendClient(boolean cacheBackendClient) 设置是否缓存 HTTP 后端 Client 对象ForestRequest.setCharset(String charset) 设置请求参数编码字符集ForestRequest.setConnectTimeout(int connectTimeout) 设置连接超时时间,时间单位为毫秒ForestRequest.setContentEncoding(String contentEncoding) ForestRequest.setContentType(String contentType) 设置请求头 Content-Type 的值ForestRequest.setDataType(ForestDataType dataType) ForestRequest.setDecoder(ForestConverter decoder) 设置反序列化器ForestRequest.setDecompressResponseGzipEnabled(boolean decompressResponseGzipEnabled) 设置是否开启解压GZIP响应内容ForestRequest.setDownloadFile(boolean downloadFile) 设置该请求是否下载文件ForestRequest.setDownloadFile(String dir, String filename) 设置该请求是否下载文件ForestRequest.setEncoder(ForestEncoder encoder) 设置序列化器设置URL主机地址ForestRequest.setHostnameVerifier(HostnameVerifier hostnameVerifier) 设置SSL主机名/域名验证器ForestRequest.setKeyStore(SSLKeyStore keyStore) 设置SSL KeyStore信息ForestRequest.setLifeCycleHandler(LifeCycleHandler lifeCycleHandler) 设置生命周期处理器ForestRequest.setLogConfiguration(LogConfiguration logConfiguration) ForestRequest.setMaxRetryCount(int retryCount) 设置请求失败后的重试次数ForestRequest.setMaxRetryInterval(long maxRetryInterval) 设置最大请重试的时间间隔,时间单位为毫秒ForestRequest.setMultiparts(List<ForestMultipart> multiparts) 设置 Multiparts 列表ForestRequest.setOnCanceled(OnCanceled onCanceled) 设置OnCanceled回调函数,该回调函数在请求取消后被调用ForestRequest.setOnError(OnError onError) 设置OnError回调函数,该回调函数在请求失败时被调用ForestRequest.setOnLoadCookie(OnLoadCookie onLoadCookie) 设置回调函数: 加载Cookie时调用ForestRequest.setOnProgress(OnProgress onProgress) 设置进度回调函数:上传/下载进度监听时调用ForestRequest.setOnRedirection(OnRedirection onRedirection) 设置重定向回调函数: 在请求重定向时触发ForestRequest.setOnRetry(OnRetry onRetry) 设置OnRetry回调函数,该回调函数在请求重试时被调用ForestRequest.setOnSaveCookie(OnSaveCookie onSaveCookie) 设置回调函数: 需要保存Cookie时调用ForestRequest.setOnSuccess(OnSuccess onSuccess) 设置OnSuccess回调函数,该回调函数在请求成功时被调用设置URL路径ForestRequest.setPort(int port) 设置URL主机端口ForestRequest.setProgressStep(long progressStep) 设置获取上传/下载进度监听的步长ForestRequest.setProtocol(ForestProtocol protocol) 设置请求协议ForestRequest.setProxy(ForestProxy proxy) 设置正向代理ForestRequest.setReadTimeout(int readTimeout) 设置读取超时时间,时间单位为毫秒设置Reference, 即URL井号(#)后面的字符串ForestRequest.setResponseEncode(String responseEncode) ForestRequest.setRetryCount(int retryCount) 已过时。ForestRequest.setRetryEnabled(boolean retryEnabled) 设置是否开启请求重试ForestRequest.setRetryer(ForestRetryer retryer) 设置Forest请求重试器ForestRequest.setRetryer(Class<? extends ForestRetryer> retryerClass) 设置Forest请求重试器ForestRequest.setRetryWhen(RetryWhen retryWhen) 设置RetryWhen回调函数, 回调函数为请求重试的触发条件ForestRequest.setRetryWhen(Class<? extends RetryWhen> conditionClass) 设置RetryWhen回调函数, 回调函数为请求重试的触发条件设置URL地址的HTTP协议头ForestRequest.setSslProtocol(String sslProtocol) 设置SSL协议ForestRequest.setSslSocketFactoryBuilder(SSLSocketFactoryBuilder sslSocketFactoryBuilder) 设置 SSL Socket 工厂构造器ForestRequest.setSuccessWhen(SuccessWhen successWhen) 设置SuccessWhen回调函数,该回调函数用于判断请求是否成功ForestRequest.setSuccessWhen(Class<? extends SuccessWhen> conditionClass) 设置SuccessWhen回调函数,该回调函数用于判断请求是否成功ForestRequest.setTimeout(int timeout) 已过时。ForestRequest.setType(ForestRequestType type) 设置请求类型ForestRequest.setUrl(MappingURLTemplate urlTemplate, Object... args) 设置请求的url地址设置请求的url地址设置请求的url地址ForestRequest.setUserAgent(String userAgent) ForestRequest.setUserInfo(String userInfo) 设置URL用户验证信息ForestRequest.sslSocketFactoryBuilder(SSLSocketFactoryBuilder sslSocketFactoryBuilder) 设置 SSL Socket 工厂构造器ForestRequest.successWhen(SuccessWhen successWhen) 设置SuccessWhen回调函数,该回调函数用于判断请求是否成功ForestRequest.successWhen(Class<? extends SuccessWhen> conditionClass) 设置SuccessWhen回调函数,该回调函数用于判断请求是否成功ForestRequest.sync()设置为同步ForestRequest.type(ForestRequestType type) 设置请求类型设置请求URL设置请求URL设置URL用户验证信息参数类型为ForestRequest的com.dtflys.forest.http中的方法修饰符和类型方法说明ForestBody.clone(ForestRequest request) ForestQueryMap.clone(ForestRequest request) ForestResponseFactory.createResponse(ForestRequest<?> request, R res, LifeCycleHandler lifeCycleHandler, Throwable exception, Date requestTime) default TLazy.eval(ForestRequest req) 进行求值Lazy.getValue(ForestRequest req) 调用 Lambda 进行求值default booleanLazy.isEvaluating(ForestRequest req) 当前延迟参数是否正在求值static booleanLazy.isEvaluatingLazyValue(Object value, ForestRequest request) 参数类型为ForestRequest的com.dtflys.forest.http中的构造器限定符构造器说明ForestBody(ForestRequest request) ForestFuture(ForestRequest<T> request, Future<ForestResponse<T>> future) ForestQueryMap(ForestRequest request) ForestResponse(ForestRequest request, Date requestTime, Date responseTime) protectedResultGetter(ForestRequest request) -
com.dtflys.forest.http.body中ForestRequest的使用
参数类型为ForestRequest的com.dtflys.forest.http.body中的方法修饰符和类型方法说明ByteArrayRequestBody.getNameValueList(ForestRequest request) NameValueRequestBody.getNameValueList(ForestRequest request) ObjectRequestBody.getNameValueList(ForestRequest request) StringRequestBody.getNameValueList(ForestRequest request) SupportFormUrlEncoded.getNameValueList(ForestRequest request) 获取请求键值对 -
com.dtflys.forest.http.model中ForestRequest的使用
修饰符和类型方法说明JavaObjectProperty.getValue(ForestRequest request, ConvertOptions options) MapProperty.getValue(ForestRequest request, ConvertOptions options) ObjectProperty.getValue(ForestRequest request, ConvertOptions options) -
com.dtflys.forest.interceptor中ForestRequest的使用
修饰符和类型方法说明default voidInterceptor.addAttribute(ForestRequest request, String name, Object value) 添加请求在本拦截器中的 Attribute 属性default voidInterceptor.afterExecute(ForestRequest request, ForestResponse response) 默认回调函数: 请求完成后(成功/失败后) 调用该方法voidInterceptorChain.afterExecute(ForestRequest request, ForestResponse response) default booleanInterceptor.beforeExecute(ForestRequest request) 默认回调函数: 请求执行前调用该方法booleanInterceptorChain.beforeExecute(ForestRequest request) default ObjectInterceptor.getAttribute(ForestRequest request, String name) 获取请求在本拦截器中的 Attribute 属性default <T> TInterceptor.getAttribute(ForestRequest request, String name, Class<T> clazz) 按自义定类型获取请求在本拦截器中的 Attribute 属性default DoubleInterceptor.getAttributeAsDouble(ForestRequest request, String name) 按双精度浮点数类型获取请求在本拦截器中的 Attribute 属性default FloatInterceptor.getAttributeAsFloat(ForestRequest request, String name) 按单精度浮点数类型获取请求在本拦截器中的 Attribute 属性default IntegerInterceptor.getAttributeAsInteger(ForestRequest request, String name) 按整数类型获取请求在本拦截器中的 Attribute 属性default StringInterceptor.getAttributeAsString(ForestRequest request, String name) 按字符串类型获取请求在本拦截器中的 Attribute 属性default InterceptorAttributesInterceptor.getAttributes(ForestRequest request) 获取请求在本拦截器中的 Attribute 属性default byte[]Interceptor.onBodyEncode(ForestRequest request, ForestEncoder encoder, byte[] encodedData) 在请求体数据序列化后,发送请求数据前调用该方法byte[]InterceptorChain.onBodyEncode(ForestRequest request, ForestEncoder encoder, byte[] encodedData) default voidInterceptor.onCanceled(ForestRequest req, ForestResponse res) 默认回调函数: 请求取消后调用该方法voidInterceptorChain.onCanceled(ForestRequest request, ForestResponse response) default voidInterceptor.onError(ForestRuntimeException ex, ForestRequest request, ForestResponse response) 默认回调函数: 请求失败后调用该方法voidInterceptorChain.onError(ForestRuntimeException ex, ForestRequest request, ForestResponse response) default voidInterceptor.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) 默认回调函数: 接口方法执行时调用该方法voidInterceptorChain.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) default voidInterceptor.onLoadCookie(ForestRequest request, ForestCookies cookies) 默认回调函数: 在发送请求加载Cookie时调用该方法voidInterceptorChain.onLoadCookie(ForestRequest request, ForestCookies cookies) default voidInterceptor.onRedirection(ForestRequest<?> redirectReq, ForestRequest<?> prevReq, ForestResponse<?> prevRes) 默认回调函数:在请求重定向时触发voidInterceptorChain.onRedirection(ForestRequest redirectReq, ForestRequest prevReq, ForestResponse prevRes) default voidInterceptor.onRetry(ForestRequest request, ForestResponse response) 默认回调函数: 在触发请求重试时执行voidInterceptorChain.onRetry(ForestRequest request, ForestResponse response) default voidInterceptor.onSaveCookie(ForestRequest request, ForestCookies cookies) 默认回调函数: 在请求响应成功后,需要保存Cookie时调用该方法voidInterceptorChain.onSaveCookie(ForestRequest request, ForestCookies cookies) default voidInterceptor.onSuccess(T data, ForestRequest request, ForestResponse response) 默认回调函数: 请求成功后调用该方法voidInterceptorChain.onSuccess(Object data, ForestRequest request, ForestResponse response) -
com.dtflys.forest.lifecycles中ForestRequest的使用
修饰符和类型方法说明default voidBaseAnnotationLifeCycle.onError(ForestRuntimeException ex, ForestRequest request, ForestResponse response) default voidMethodAnnotationLifeCycle.onError(ForestRuntimeException ex, ForestRequest request, ForestResponse response) default voidParameterAnnotationLifeCycle.onError(ForestRuntimeException ex, ForestRequest request, ForestResponse response) default voidBaseAnnotationLifeCycle.onSuccess(I data, ForestRequest request, ForestResponse response) default voidMethodAnnotationLifeCycle.onSuccess(I data, ForestRequest request, ForestResponse response) default voidParameterAnnotationLifeCycle.onSuccess(I data, ForestRequest request, ForestResponse response) -
com.dtflys.forest.lifecycles.authorization中ForestRequest的使用
修饰符和类型方法说明booleanBasicAuthLifeCycle.beforeExecute(ForestRequest request) booleanOAuth2LifeCycle.beforeExecute(ForestRequest request) voidBasicAuthLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) -
com.dtflys.forest.lifecycles.file中ForestRequest的使用
修饰符和类型方法说明booleanDownloadLifeCycle.beforeExecute(ForestRequest request) voidDownloadLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) voidDownloadLifeCycle.onSuccess(Object data, ForestRequest request, ForestResponse response) -
com.dtflys.forest.lifecycles.method中ForestRequest的使用
修饰符和类型方法说明booleanHeadersLifeCycle.beforeExecute(ForestRequest request) booleanRequestLifeCycle.beforeExecute(ForestRequest request) voidAddressLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) voidBackendClientLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) voidBackendLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) voidDecompressGzipLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) voidRedirectionLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) voidRetryerLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) voidRetryLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) voidSSLHostnameVerifierLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) voidSSLSocketFactoryBuilderLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) voidSuccessLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) -
com.dtflys.forest.lifecycles.parameter中ForestRequest的使用
修饰符和类型方法说明booleanBinaryBodyLifeCycle.beforeExecute(ForestRequest request) booleanDataFileLifeCycle.beforeExecute(ForestRequest request) booleanFormBodyLifeCycle.beforeExecute(ForestRequest request) booleanJSONBodyLifeCycle.beforeExecute(ForestRequest request) booleanProtobufBodyLifeCycle.beforeExecute(ForestRequest request) booleanReturnLifeCycle.beforeExecute(ForestRequest request) booleanXMLBodyLifeCycle.beforeExecute(ForestRequest request) voidReturnLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) -
com.dtflys.forest.lifecycles.proxy中ForestRequest的使用
修饰符和类型方法说明booleanHTTPProxyLifeCycle.beforeExecute(ForestRequest request) voidHTTPProxyLifeCycle.onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) -
com.dtflys.forest.logging中ForestRequest的使用
参数类型为ForestRequest的com.dtflys.forest.logging中的方法 -
com.dtflys.forest.pool中ForestRequest的使用
参数类型为ForestRequest的com.dtflys.forest.pool中的方法修饰符和类型方法说明voidFixedRequestPool.awaitRequest(ForestRequest request) 提交请求voidForestRequestPool.awaitRequest(ForestRequest request) voidFixedRequestPool.finish(ForestRequest request) 请求完成voidForestRequestPool.finish(ForestRequest request) -
com.dtflys.forest.reflection中ForestRequest的使用
修饰符和类型方法说明byte[]MethodLifeCycleHandler.handleBodyEncode(ForestRequest request, ForestEncoder encoder, byte[] encodedData) byte[]NoneLifeCycleHandler.handleBodyEncode(ForestRequest request, ForestEncoder encoder, byte[] encodedData) voidMethodLifeCycleHandler.handleCanceled(ForestRequest request, ForestResponse response) voidNoneLifeCycleHandler.handleCanceled(ForestRequest request, ForestResponse response) MethodLifeCycleHandler.handleError(ForestRequest request, ForestResponse response) MethodLifeCycleHandler.handleError(ForestRequest request, ForestResponse response, Throwable ex) NoneLifeCycleHandler.handleError(ForestRequest request, ForestResponse response) NoneLifeCycleHandler.handleError(ForestRequest request, ForestResponse response, Throwable ex) MethodLifeCycleHandler.handleFuture(ForestRequest request, Future resultData) NoneLifeCycleHandler.handleFuture(ForestRequest request, Future resultData) voidMethodLifeCycleHandler.handleInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) voidNoneLifeCycleHandler.handleInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) voidMethodLifeCycleHandler.handleLoadCookie(ForestRequest request, ForestCookies cookies) voidNoneLifeCycleHandler.handleLoadCookie(ForestRequest request, ForestCookies cookies) voidMethodLifeCycleHandler.handleProgress(ForestRequest request, ForestProgress progress) voidNoneLifeCycleHandler.handleProgress(ForestRequest request, ForestProgress progress) MethodLifeCycleHandler.handleResultType(ForestRequest request, ForestResponse response) MethodLifeCycleHandler.handleResultType(ForestRequest request, ForestResponse response, Type resultType, Class resultClass) NoneLifeCycleHandler.handleResultType(ForestRequest request, ForestResponse response) NoneLifeCycleHandler.handleResultType(ForestRequest request, ForestResponse response, Type resultType, Class resultClass) voidMethodLifeCycleHandler.handleSaveCookie(ForestRequest request, ForestCookies cookies) voidNoneLifeCycleHandler.handleSaveCookie(ForestRequest request, ForestCookies cookies) voidMethodLifeCycleHandler.handleSuccess(Object resultData, ForestRequest request, ForestResponse response) voidNoneLifeCycleHandler.handleSuccess(Object resultData, ForestRequest request, ForestResponse response) MethodLifeCycleHandler.handleSync(ForestRequest request, ForestResponse response) NoneLifeCycleHandler.handleSync(ForestRequest request, ForestResponse response) MethodLifeCycleHandler.handleSyncWithException(ForestRequest request, ForestResponse response, Throwable ex) NoneLifeCycleHandler.handleSyncWithException(ForestRequest request, ForestResponse response, Throwable ex) -
com.dtflys.forest.retryer中ForestRequest的使用
修饰符和类型字段说明protected final ForestRequestBackOffRetryer.requestprotected final ForestRequestForestRetryer.request参数类型为ForestRequest的com.dtflys.forest.retryer中的构造器限定符构造器说明BackOffRetryer(ForestRequest request) protectedForestRetryer(ForestRequest request) NoneRetryer(ForestRequest request) -
com.dtflys.forest.ssl中ForestRequest的使用
参数类型为ForestRequest的com.dtflys.forest.ssl中的方法修饰符和类型方法说明static SSLContextSSLUtils.customSSL(ForestRequest request) 自定义SSL证书static SSLSocketFactorySSLUtils.getDefaultSSLSocketFactory(ForestRequest request, String protocol) static SSLContextSSLUtils.getSSLContext(ForestRequest request, String protocol) 获取SSL上下文SocksProxySSLSocketFactoryBuilder.getSSLSocketFactory(ForestRequest request, String protocol) SSLSocketFactoryBuilder.getSSLSocketFactory(ForestRequest request, String protocol) 获取SSL Socket Factory -
com.dtflys.forest.utils中ForestRequest的使用
参数类型为ForestRequest的com.dtflys.forest.utils中的构造器