springboot 使用restTemplate发送post请求,传json数据,结果报错401 Unauthorized: [no body] 添加相应的数据格式就解决了 @Bean public RestTemplate registerTemplate() { RestTemplate re ...
分类:
其他好文 时间:
2020-07-22 20:32:37
阅读次数:
286
1:Feign是什么Feign是一个声明式的Web服务客户端,使得编写Web服务客户端变得非常容易,只需要创建一个接口,然后在上面添加注解即可。官网:https://github.com/OpenFeign/feign2:Feign能干什么Feign旨在使编写JavaHttp客户端变得更容易。前面在使用SpringCloudRibbon+RestTemplate时,利用RestTemplate对h
分类:
编程语言 时间:
2020-07-15 13:11:36
阅读次数:
81
入职新公司,用的SpringCloud,重新开始学习一下 简介 之前接触Ribbon,可以知道调用微服务的方法是指定地址,然后通过RestTemplate来实现调用,用起来有点别扭,因为跟使用HttpClient来调用http接口的感觉是一样的,完全不是面向接口编程。 Feign是一个声明性的Web ...
分类:
编程语言 时间:
2020-07-13 18:23:13
阅读次数:
63
使用restTemplate获取语音文件,在线播放 public void getAudioTest(HttpServletRequest request, HttpServletResponse response) { try { response.setContentType("audio/wa ...
分类:
其他好文 时间:
2020-07-07 13:31:36
阅读次数:
84
Ribbon入门介绍,
Ribbon负载均衡演示,
RestTemplate详解,
Ribbon核心组件IRule,
Ribbon负载均衡算法, ...
分类:
编程语言 时间:
2020-06-27 18:37:07
阅读次数:
74
Could not autowire. No beans of 'RestTemplate' type found. more... 一.问题描述: 今天在springboot项目中构建配置类时报错 二.问题分析: 经网上查询得知, idea的纠错机制在解析spring通过命名约定的方式进行配置时, ...
分类:
编程语言 时间:
2020-06-26 20:30:14
阅读次数:
70
RestTemplate介绍 RestTemplate简介 ? spring框架提供的RestTemplate类可用于在应用中调用rest服务,它简化了与http服务的通信方式,统一了RESTful的标准,封装了http链接, 我们只需要传入url及返回值类型即可。相较于之前常用的HttpClien ...
分类:
其他好文 时间:
2020-06-24 00:07:35
阅读次数:
72
springboot使用TestRestTemplate单元测试时,提示ResourceAccess I/O error on POST request for "http 发现如果后台的http状态码返回401则会出现这种情况(其他4XX等可能也会) 解决方案,pom.xml加入 <depende ...
分类:
数据库 时间:
2020-06-23 19:45:40
阅读次数:
426
MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<String, Object>(); postParameters.add("pageNum", pageNum); postParameters.add(" ...
分类:
编程语言 时间:
2020-06-10 17:32:32
阅读次数:
98
转发:https://blog.csdn.net/weixin_33724659/article/details/93338398?utm_medium=distribute.pc_relevant_right.none-task-blog-BlogCommendFromMachineLearnPa ...
分类:
编程语言 时间:
2020-05-27 17:06:00
阅读次数:
102