sending https post request with post data using spring web

前端 未结 1 834
故里飘歌
故里飘歌 2021-01-22 11:24

I\'m trying to understand how to send https post request with post data using spring web or and other spring tools.

so far I\'ve been using httpclient but i\'m trying to

1条回答
  •  庸人自扰
    2021-01-22 11:35

    I use Spring Integration to send http POST and GET http://static.springsource.org/spring-integration/reference/html/http.html The request-factory bean need to be configured to allow self-signed certificates. I use the following wiring to declare apacheHttpsRequestFactory to be used by http Spring Integration endpoints.

    The httpClient bean can be injected to other Spring Beans and used to send http requests:

    @Autowired
    private HttpClient httpClient;
    

    Here is the fragment of spring-intefration-context.xml:

    
    
        
            
        
        
            
        
    
    
        
            
                
                    
    
                        
                        
                        
                    
                
            
        
    
    
        
            
                
            
        
    
    
        
    

    0 讨论(0)
提交回复
热议问题