2021
07-04
07-04
详解SpringCloud微服务之Rest
目录一、什么是RestTemplate?二、四种请求方式2.1GET请求2.2POST请求2.3PUT请求2.4DELETE请求一、什么是RestTemplate?RestTemplate是一个HTTP客户端,在SpringCloud的服务调用方使用它我们可以方便的调用HTTP接口,支持GET、POST、PUT、DELETE等方法。二、四种请求方式首先注入Bean对象@ConfigurationpublicclassMyConfig{@BeanpublicRestTemplaterestTemplate(){returnnewRestTemplate();}}2.1GET请...
继续阅读 >