This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import org.springframework.boot.context.properties.ConfigurationProperties; | |
| @ConfigurationProperties("http.client") | |
| public class HttpClientProperties { | |
| private int connectionTimeoutInMillis = 1_000; | |
| private int readTimeoutInMillis = 10_000; | |
| /** Used to configure both the default max per route as well as the maximum total connections. */ | |
| private int maxConnections = 200; | |
| /** | |
| * Configures a LoggingClientHttpRequestInterceptor and a BufferingClientHttpRequestFactory, | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.http.HttpHeaders; | |
| import org.springframework.http.HttpRequest; | |
| import org.springframework.http.MediaType; | |
| import org.springframework.http.client.ClientHttpRequestExecution; | |
| import org.springframework.http.client.ClientHttpRequestInterceptor; | |
| import org.springframework.http.client.ClientHttpResponse; | |
| import org.springframework.util.StreamUtils; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package net.hang321.http.client; | |
| import java.io.IOException; | |
| import java.net.InetSocketAddress; | |
| import java.net.Socket; | |
| import java.net.URI; | |
| import java.util.LinkedHashSet; | |
| import java.util.Set; | |
| import org.slf4j.Logger; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // Enable component-scanning and auto-configuration with @SpringBootApplication Annotation | |
| // It combines @Configuration + @ComponentScan + @EnableAutoConfiguration | |
| @SpringBootApplication | |
| public class FooApplication { | |
| public static void main(String[] args) { | |
| // Bootstrap the application | |
| SpringApplication.run(FooApplication.class, args); | |
| } | |
| } | 
NewerOlder