义齿

10872 ワード


id="pollingConnectionManager" class="org.apache.http.impl.conn.PoolingHttpClientConnectionManager">
    
    name="maxTotal" value="1000" />
    
    name="defaultMaxPerRoute" value="1000" />


id="httpClientBuilder" class="org.apache.http.impl.client.HttpClientBuilder" factory-method="create">
    name="connectionManager" ref="pollingConnectionManager" />
    
    name="retryHandler">
        class="org.apache.http.impl.client.DefaultHttpRequestRetryHandler">
            value="2"/>
            value="true"/>
        
    
    name="defaultHeaders">
        
            class="org.apache.http.message.BasicHeader">
                value="User-Agent"/>
                value="Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.16 Safari/537.36"/>
            
            class="org.apache.http.message.BasicHeader">
                value="Accept-Encoding"/>
                value="gzip,deflate"/>
            
            class="org.apache.http.message.BasicHeader">
                value="Accept-Language"/>
                value="zh-CN"/>
            
        
    


id="httpClient" factory-bean="httpClientBuilder" factory-method="build" />

id="clientHttpRequestFactory" class="org.springframework.http.client.HttpComponentsClientHttpRequestFactory">
    ref="httpClient"/>
    
    name="connectTimeout" value="5000"/>
    
    name="readTimeout" value="10000"/>


id="restTemplate" class="org.springframework.web.client.RestTemplate">
    ref="clientHttpRequestFactory"/>
    name="errorHandler">
        class="org.springframework.web.client.DefaultResponseErrorHandler"/>
    
    name="messageConverters">
        
            class="org.springframework.http.converter.FormHttpMessageConverter"/>
            class="org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter"/>
            class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
            class="org.springframework.http.converter.StringHttpMessageConverter">
                name="supportedMediaTypes">
                    
                        text/plain;charset=UTF-8