Class HttpAccessor
java.lang.Object
org.springframework.http.client.support.HttpAccessor
- Direct Known Subclasses:
- InterceptingHttpAccessor
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 SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected ClientHttpRequestcreateRequest(URI url, HttpMethod method) Create a newClientHttpRequestvia this template'sClientHttpRequestFactory.Get the request initializers that this accessor uses.Return the request factory that this accessor uses for obtaining client request handles.voidsetClientHttpRequestInitializers(List<ClientHttpRequestInitializer> clientHttpRequestInitializers) Set the request initializers that this accessor should use.voidsetRequestFactory(ClientHttpRequestFactory requestFactory) Set the request factory that this accessor uses for obtaining client request handles.
- 
Field Details- 
loggerLogger available to subclasses.
 
- 
- 
Constructor Details- 
HttpAccessorpublic HttpAccessor()
 
- 
- 
Method Details- 
setRequestFactorySet 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. 
- 
getRequestFactoryReturn the request factory that this accessor uses for obtaining client request handles.
- 
setClientHttpRequestInitializerspublic void setClientHttpRequestInitializers(List<ClientHttpRequestInitializer> clientHttpRequestInitializers) Set the request initializers that this accessor should use.The initializers will get immediately sorted according to their order. - Since:
- 5.2
 
- 
getClientHttpRequestInitializersGet 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:
 
- 
createRequestCreate a newClientHttpRequestvia this template'sClientHttpRequestFactory.- Parameters:
- url- the URL to connect to
- method- the HTTP method to execute (GET, POST, etc)
- Returns:
- the created request
- Throws:
- IOException- in case of I/O errors
- See Also:
 
 
-