Class HttpAccessor
java.lang.Object
org.springframework.http.client.support.HttpAccessor
- Direct Known Subclasses:
InterceptingHttpAccessor
Deprecated, for removal: This API element is subject to removal in a future version.
since 7.1 with no replacement.
Base class for
RestTemplate
and other HTTP accessing gateway helpers, defining common properties
such as the ClientHttpRequestFactory to operate on.
Not intended to be used directly.
See RestTemplate for an entry point.
- Since:
- 3.0
- Author:
- Arjen Poutsma, Juergen Hoeller, Phillip Webb
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.commons.logging.LogDeprecated, for removal: This API element is subject to removal in a future version.Logger available to subclasses. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected ClientHttpRequestcreateRequest(URI url, HttpMethod method) Deprecated, for removal: This API element is subject to removal in a future version.Create a newClientHttpRequestvia this template'sClientHttpRequestFactory.Deprecated, for removal: This API element is subject to removal in a future version.Return theconfiguredpredicate to determine whether to buffer request and response content.Deprecated, for removal: This API element is subject to removal in a future version.Get the request initializers that this accessor uses.Deprecated, for removal: This API element is subject to removal in a future version.Return the request factory that this accessor uses for obtaining client request handles.voidsetBufferingPredicate(@Nullable BiPredicate<URI, HttpMethod> predicate) Deprecated, for removal: This API element is subject to removal in a future version.Enable buffering of request and response, aggregating all content before it is sent, and making it possible to read the response body repeatedly.voidsetClientHttpRequestInitializers(List<ClientHttpRequestInitializer> clientHttpRequestInitializers) Deprecated, for removal: This API element is subject to removal in a future version.Set the request initializers that this accessor should use.voidsetRequestFactory(ClientHttpRequestFactory requestFactory) Deprecated, for removal: This API element is subject to removal in a future version.Set the request factory that this accessor uses for obtaining client request handles.
-
Field Details
-
logger
protected final org.apache.commons.logging.Log loggerDeprecated, for removal: This API element is subject to removal in a future version.Logger available to subclasses.
-
-
Constructor Details
-
HttpAccessor
public HttpAccessor()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
setRequestFactory
Deprecated, for removal: This API element is subject to removal in a future version.Set the request factory that this accessor uses for obtaining client request handles.The default is a
SimpleClientHttpRequestFactorybased on the JDK's own HTTP libraries (HttpURLConnection).Note that the standard JDK HTTP library does not support the HTTP PATCH method. Configure the Apache HttpComponents or OkHttp request factory to enable PATCH.
- See Also:
-
getRequestFactory
Deprecated, for removal: This API element is subject to removal in a future version.Return the request factory that this accessor uses for obtaining client request handles. -
setClientHttpRequestInitializers
public void setClientHttpRequestInitializers(List<ClientHttpRequestInitializer> clientHttpRequestInitializers) Deprecated, for removal: This API element is subject to removal in a future version.Set the request initializers that this accessor should use.The initializers will get immediately sorted according to their order.
- Since:
- 5.2
-
getClientHttpRequestInitializers
Deprecated, for removal: This API element is subject to removal in a future version.Get the request initializers that this accessor uses.The returned
Listis active and may be modified. Note, however, that the initializers will not be resorted according to their order before theClientHttpRequestis initialized.- Since:
- 5.2
- See Also:
-
setBufferingPredicate
Deprecated, for removal: This API element is subject to removal in a future version.Enable buffering of request and response, aggregating all content before it is sent, and making it possible to read the response body repeatedly.- Parameters:
predicate- to determine whether to buffer for the given request- Since:
- 7.0
-
getBufferingPredicate
Deprecated, for removal: This API element is subject to removal in a future version.Return theconfiguredpredicate to determine whether to buffer request and response content.- Since:
- 7.0
-
createRequest
Deprecated, for removal: This API element is subject to removal in a future version.Create a newClientHttpRequestvia this template'sClientHttpRequestFactory.- Parameters:
url- the URL to connect tomethod- the HTTP method to execute (GET, POST, etc)- Returns:
- the created request
- Throws:
IOException- in case of I/O errors- See Also:
-