类 AbstractClientHttpRequest
java.lang.Object
cn.taketoday.http.client.AbstractClientHttpRequest
- 所有已实现的接口:
ClientHttpRequest,HttpMessage,HttpOutputMessage,HttpRequest
Abstract base for
ClientHttpRequest that makes sure that headers
and body are not written multiple times.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected voidAssert that this request has not been executed yet.final ClientHttpResponseexecute()Execute this request, resulting in aClientHttpResponsethat can be read.protected abstract ClientHttpResponseexecuteInternal(HttpHeaders headers) Abstract template method that writes the given headers and content to the HTTP request.final OutputStreamgetBody()Return the body of the message as an output stream.protected abstract OutputStreamgetBodyInternal(HttpHeaders headers) Abstract template method that returns the body.final HttpHeadersReturn the headers of this message.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.http.HttpRequest
getMethod, getMethodValue, getURI
-
字段详细资料
-
headers
-
executed
private boolean executed -
readOnlyHeaders
-
-
构造器详细资料
-
AbstractClientHttpRequest
public AbstractClientHttpRequest()
-
-
方法详细资料
-
getHeaders
从接口复制的说明:HttpMessageReturn the headers of this message.- 指定者:
getHeaders在接口中HttpMessage- 返回:
- a corresponding HttpHeaders object (never
null)
-
getBody
从接口复制的说明:HttpOutputMessageReturn the body of the message as an output stream.- 指定者:
getBody在接口中HttpOutputMessage- 返回:
- the output stream body (never
null) - 抛出:
IOException- in case of I/O errors
-
execute
从接口复制的说明:ClientHttpRequestExecute this request, resulting in aClientHttpResponsethat can be read.- 指定者:
execute在接口中ClientHttpRequest- 返回:
- the response result of the execution
- 抛出:
IOException- in case of I/O errors
-
assertNotExecuted
protected void assertNotExecuted()Assert that this request has not been executed yet.- 抛出:
IllegalStateException- if this request has been executed
-
getBodyInternal
Abstract template method that returns the body.- 参数:
headers- the HTTP headers- 返回:
- the body output stream
- 抛出:
IOException
-
executeInternal
Abstract template method that writes the given headers and content to the HTTP request.- 参数:
headers- the HTTP headers- 返回:
- the response object for the executed request
- 抛出:
IOException
-