| | |
| | | package com.highdatas.mdm.util; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.*; |
| | | import org.springframework.http.client.SimpleClientHttpRequestFactory; |
| | | import org.springframework.util.MultiValueMap; |
| | |
| | | |
| | | public class HttpUtils { |
| | | |
| | | |
| | | public static String HttpRestClient(String url, HttpMethod method, MultiValueMap<String, String> params) { |
| | | SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); |
| | | requestFactory.setConnectTimeout(15*1000); |
| | |
| | | ResponseEntity<String> response = client.exchange(url, method, requestEntity, String.class); |
| | | return response.getBody(); |
| | | } |
| | | |
| | | |
| | | } |