类 BufferingClientHttpRequestFactory
java.lang.Object
cn.taketoday.http.client.ClientHttpRequestFactoryWrapper
cn.taketoday.http.client.BufferingClientHttpRequestFactory
- 所有已实现的接口:
ClientHttpRequestFactory
Wrapper for a
ClientHttpRequestFactory that buffers
all outgoing and incoming streams in memory.
Using this wrapper allows for multiple reads of the response body.
- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma
-
构造器概要
构造器构造器说明BufferingClientHttpRequestFactory(ClientHttpRequestFactory requestFactory) Create a buffering wrapper for the givenClientHttpRequestFactory. -
方法概要
修饰符和类型方法说明protected ClientHttpRequestcreateRequest(URI uri, HttpMethod httpMethod, ClientHttpRequestFactory requestFactory) Create a newClientHttpRequestfor the specified URI and HTTP method by using the passed-on request factory.protected booleanshouldBuffer(URI uri, HttpMethod httpMethod) Indicates whether the request/response exchange for the given URI and method should be buffered in memory.从类继承的方法 cn.taketoday.http.client.ClientHttpRequestFactoryWrapper
createRequest, getRequestFactory
-
构造器详细资料
-
BufferingClientHttpRequestFactory
Create a buffering wrapper for the givenClientHttpRequestFactory.- 参数:
requestFactory- the target request factory to wrap
-
-
方法详细资料
-
createRequest
protected ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod, ClientHttpRequestFactory requestFactory) throws IOException 从类复制的说明:ClientHttpRequestFactoryWrapperCreate a newClientHttpRequestfor the specified URI and HTTP method by using the passed-on request factory.Called from
ClientHttpRequestFactoryWrapper.createRequest(URI, HttpMethod).- 覆盖:
createRequest在类中ClientHttpRequestFactoryWrapper- 参数:
uri- the URI to create a request forhttpMethod- the HTTP method to executerequestFactory- the wrapped request factory- 返回:
- the created request
- 抛出:
IOException- in case of I/O errors
-
shouldBuffer
Indicates whether the request/response exchange for the given URI and method should be buffered in memory.The default implementation returns
truefor all URIs and methods. Subclasses can override this method to change this behavior.- 参数:
uri- the URIhttpMethod- the method- 返回:
trueif the exchange should be buffered;falseotherwise
-