类 CustomAsyncHttpResponse

java.lang.Object
org.apache.hc.core5.http.message.HeaderGroup
org.apache.hc.core5.http.message.BasicHttpResponse
org.apache.hc.core5.http.message.BasicClassicHttpResponse
com.luna.common.net.async.CustomAsyncHttpResponse
所有已实现的接口:
Closeable, Serializable, AutoCloseable, org.apache.hc.core5.http.ClassicHttpResponse, org.apache.hc.core5.http.HttpEntityContainer, org.apache.hc.core5.http.HttpMessage, org.apache.hc.core5.http.HttpResponse, org.apache.hc.core5.http.MessageHeaders

public final class CustomAsyncHttpResponse extends org.apache.hc.core5.http.message.BasicClassicHttpResponse
HTTP response that can enclose a body represented as a simple text string or an array of bytes.

IMPORTANT: CustomAsyncHttpResponses are intended for simple scenarios where entities inclosed in responses are known to be small. It is generally recommended to use streaming AsyncResponseConsumers, for instance, such as based on AbstractCharResponseConsumer or AbstractBinResponseConsumer.

从以下版本开始:
5.0
另请参阅:
  • SimpleBody
  • AbstractCharResponseConsumer
  • AbstractBinResponseConsumer
  • 序列化表格
  • 构造器概要

    构造器
    构造器
    说明
     
    CustomAsyncHttpResponse(int code, String reasonPhrase)
     
  • 方法概要

    修饰符和类型
    方法
    说明
    copy(org.apache.hc.core5.http.HttpResponse original)
     
    create(int code)
     
    create(int code, byte[] content)
     
    create(int code, byte[] content, org.apache.hc.core5.http.ContentType contentType)
     
    create(int code, String content)
     
    create(int code, String content, org.apache.hc.core5.http.ContentType contentType)
     
     
    byte[]
     
     
    org.apache.hc.core5.http.ContentType
     
    void
    setBody(byte[] bodyBytes, org.apache.hc.core5.http.ContentType contentType)
     
    void
     
    void
    setBody(String bodyText, org.apache.hc.core5.http.ContentType contentType)
     

    从类继承的方法 org.apache.hc.core5.http.message.BasicClassicHttpResponse

    close, getEntity, setEntity

    从类继承的方法 org.apache.hc.core5.http.message.BasicHttpResponse

    addHeader, getCode, getLocale, getReason, getReasonPhrase, getVersion, setCode, setHeader, setLocale, setReasonPhrase, setVersion, toString

    从类继承的方法 org.apache.hc.core5.http.message.HeaderGroup

    addHeader, clear, containsHeader, countHeaders, getCondensedHeader, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, headerIterator, headerIterator, removeHeader, removeHeaders, removeHeaders, setHeader, setHeaders

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    从接口继承的方法 org.apache.hc.core5.http.HttpMessage

    addHeader, addHeader, getVersion, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setVersion

    从接口继承的方法 org.apache.hc.core5.http.HttpResponse

    getCode, getLocale, getReasonPhrase, setCode, setLocale, setReasonPhrase

    从接口继承的方法 org.apache.hc.core5.http.MessageHeaders

    containsHeader, countHeaders, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, headerIterator, headerIterator
  • 构造器详细资料

    • CustomAsyncHttpResponse

      public CustomAsyncHttpResponse(int code)
    • CustomAsyncHttpResponse

      public CustomAsyncHttpResponse(int code, String reasonPhrase)
  • 方法详细资料

    • copy

      public static CustomAsyncHttpResponse copy(org.apache.hc.core5.http.HttpResponse original)
    • create

      public static CustomAsyncHttpResponse create(int code)
    • create

      public static CustomAsyncHttpResponse create(int code, String content, org.apache.hc.core5.http.ContentType contentType)
    • create

      public static CustomAsyncHttpResponse create(int code, String content)
    • create

      public static CustomAsyncHttpResponse create(int code, byte[] content, org.apache.hc.core5.http.ContentType contentType)
    • create

      public static CustomAsyncHttpResponse create(int code, byte[] content)
    • setBody

      public void setBody(byte[] bodyBytes, org.apache.hc.core5.http.ContentType contentType)
    • setBody

      public void setBody(String bodyText, org.apache.hc.core5.http.ContentType contentType)
    • getBody

      public CustomResponseBody getBody()
    • setBody

      public void setBody(CustomResponseBody body)
    • getContentType

      public org.apache.hc.core5.http.ContentType getContentType()
    • getBodyText

      public String getBodyText()
    • getBodyBytes

      public byte[] getBodyBytes()