diff --git a/src/main/java/com/lxg/springboot/controller/HttpClientController.java b/src/main/java/com/lxg/springboot/controller/HttpClientController.java new file mode 100644 index 0000000..1943841 --- /dev/null +++ b/src/main/java/com/lxg/springboot/controller/HttpClientController.java @@ -0,0 +1,25 @@ +package com.lxg.springboot.controller; + +import com.lxg.springboot.http.HttpAPIService; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * Created by lxg + * on 2017/2/6. + */ +@RestController +public class HttpClientController { + + @Resource + private HttpAPIService httpAPIService; + + @RequestMapping("httpclient") + public String test() throws Exception { + String str = httpAPIService.doGet("http://www.baidu.com"); + System.out.println(str); + return "hello"; + } +}