类 AbstractBodyBuilder<T>

java.lang.Object
com.dtflys.forest.backend.body.AbstractBodyBuilder<T>
所有已实现的接口:
BodyBuilder<T>
直接已知子类:
HttpclientBodyBuilder, OkHttp3BodyBuilder

public abstract class AbstractBodyBuilder<T> extends Object implements BodyBuilder<T>
通用的请求体构造器抽象类
从以下版本开始:
2018-02-27 18:06
作者:
gongjun[jun.gong@thebeastshop.com]
  • 构造器详细资料

    • AbstractBodyBuilder

      public AbstractBodyBuilder()
  • 方法详细资料

    • buildBody

      public void buildBody(T httpRequest, ForestRequest request, LifeCycleHandler lifeCycleHandler)
      构建请求体
      指定者:
      buildBody 在接口中 BodyBuilder<T>
      参数:
      httpRequest - 后端http请求对象
      request - Forest请Cont求对象
      lifeCycleHandler - 生命周期处理器
    • setBody

      public void setBody(T httpReq, ForestRequest request, byte[] bytes, String charset, String contentType, boolean mergeCharset)
    • setStringBody

      protected abstract void setStringBody(T httpReq, ForestRequest request, String text, String charset, String contentType, boolean mergeCharset)
      设置字符串请求体
      参数:
      httpReq - 后端请求对象
      request - Forest请求对象
      text - 字符串文本
      charset - 字符集
      contentType - 数据类型
      mergeCharset - 是否合并字符集
    • setFileBody

      protected abstract void setFileBody(T httpReq, ForestRequest request, Charset charset, String contentType, LifeCycleHandler lifeCycleHandler)
      设置文件请求体
      参数:
      httpReq - 后端请求对象
      request - Forest请求对象
      charset - 字符集
      contentType - 数据类型
      lifeCycleHandler - 生命周期处理器
    • setBinaryBody

      protected abstract void setBinaryBody(T httpReq, ForestRequest request, String charset, String contentType, byte[] bytes, boolean mergeCharset)
      设置二进制请求体
      参数:
      httpReq - 后端请求对象
      request - Forest请求对象
      charset - 字符集
      contentType - 数据类型
      bytes - 字节数组
      mergeCharset - 合并的字符集