类 IntrospectingClientHttpResponse
java.lang.Object
cn.taketoday.http.client.ClientHttpResponseDecorator
cn.taketoday.web.client.IntrospectingClientHttpResponse
- 所有已实现的接口:
ClientHttpResponse,HttpInputMessage,HttpMessage,Closeable,AutoCloseable
class IntrospectingClientHttpResponse
extends ClientHttpResponseDecorator
implements ClientHttpResponse
Implementation of
ClientHttpResponse that can not only check if
the response has a message body, but also if its length is 0 (i.e. empty)
by actually reading the input stream.- 从以下版本开始:
- 4.0
- 作者:
- Brian Clozel, Harry Yang
- 另请参阅:
-
字段概要
字段从类继承的字段 cn.taketoday.http.client.ClientHttpResponseDecorator
delegate -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明getBody()Return the body of the message as an input stream.booleanIndicates whether the response has an empty message body.booleanIndicates whether the response has a message body.从类继承的方法 cn.taketoday.http.client.ClientHttpResponseDecorator
close, getDelegate, getHeaders, getRawStatusCode, getStatusCode, getStatusText从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.http.client.ClientHttpResponse
close, getRawStatusCode, getStatusCode, getStatusText从接口继承的方法 cn.taketoday.http.HttpMessage
getHeaders
-
字段详细资料
-
pushbackInputStream
-
-
构造器详细资料
-
IntrospectingClientHttpResponse
-
-
方法详细资料
-
hasMessageBody
Indicates whether the response has a message body.Implementation returns
falsefor:- a response status of
1XX,204or304 - a
Content-Lengthheader of0
- 返回:
trueif the response has a message body,falseotherwise- 抛出:
IOException- in case of I/O errors
- a response status of
-
hasEmptyMessageBody
Indicates whether the response has an empty message body.Implementation tries to read the first bytes of the response stream:
- if no bytes are available, the message body is empty
- otherwise it is not empty and the stream is reset to its start for further reading
- 返回:
trueif the response has a zero-length message body,falseotherwise- 抛出:
IOException- in case of I/O errors
-
getBody
从接口复制的说明:HttpInputMessageReturn the body of the message as an input stream.- 指定者:
getBody在接口中HttpInputMessage- 覆盖:
getBody在类中ClientHttpResponseDecorator- 返回:
- the input stream body (never
null) - 抛出:
IOException- in case of I/O errors
-