no suitable HttpMessageConverter found for response type
在使用 RestTemplate 或者 Spring Cloud 的时候,经常会出现这个错误。
基本上出现的场景都是,我们要json,结果来了个 text/html。
两个原因:
第一个就是:服务器返回的就是 text/html 或者不是你要的格式,那么就需要修改 HttpMessageConverter 增加格式类型。
一般这种情况都是请求别人的服务器。
第二种就是:这种是莫名其妙出现的这个错误,请求的是自己的服务器,或者明知服务器返回的是json格式,却还出现这个错误。
显示返回了 text/html 格式。那就是请求出现了错误,比如400,403,500。这样返回的都不是json,却是text/html。
no suitable HttpMessageConverter found for response type的更多相关文章
- no suitable HttpMessageConverter found for request type [java.lang.Integer]
今天在使用Spring Template的时候遇到了这个异常: no suitable HttpMessageConverter found for request type [java.lang.I ...
- RestTemplate异常no suitable HttpMessageConverter found for request type [java.lang.Integer]
GET方式,参数必须放在URL后面,http://xxx/list?name={name}&age={age} package com.chelizi.xiruo.xframework.uti ...
- RestTemplate HttpMessageConverter报错的解决方案no suitable HttpMessageConverter
错误 no suitable HttpMessageConverter found for response type and content type [text/html;charset=UTF- ...
- 【FAQ】Could not extract response: no suitable HttpMessageConverter found for respo
原因: 1:某些必须传入的参数没传 2:返回对象的接收类型不一致
- RestTemplate 微信接口 text/plain HttpMessageConverter
一.背景介绍 使用 Spring Boot 写项目,需要用到微信接口获取用户信息. 在 Jessey 和 Spring RestTemplate 两个 Rest 客户端中,想到尽量不引入更多的东西,然 ...
- Androidannotation使用之@Rest与server交互的JSON数据转换(二)
开篇 之前的一篇博客:Androidannotation使用之@Rest获取资源及用户登录验证(一):http://blog.csdn.net/nupt123456789/article/detail ...
- Spring Boot使用RestTemplate消费REST服务的几个问题记录
我们可以通过Spring Boot快速开发REST接口,同时也可能需要在实现接口的过程中,通过Spring Boot调用内外部REST接口完成业务逻辑. 在Spring Boot中,调用REST Ap ...
- 004-RestTemplate 使用常见问题
一.使用 同前三节:ClientGetGoodsByGoodsIdResponse response = restTemplate.postForObject(svcUrl, request, Res ...
- RestTemplate 使用中的几个问题
Spring Boot使用RestTemplate消费REST服务的几个问题记录 我们可以通过Spring Boot快速开发REST接口,同时也可能需要在实现接口的过程中,通过Spring Boot调 ...
随机推荐
- Xshell设置密钥登录确保Linux
用Xshell设置密匙登陆服务器, 第一步.使用Xshell生成密钥 我们打开熟悉的XSHELL软件,然后在工具-新建用户密钥生成向导. 到了生成密钥参数界面,我们这里需要选择RSA密钥类型,以及密钥 ...
- 2019ICPC网赛南京站B题 super_log(欧拉降幂
https://nanti.jisuanke.com/t/41299 题意:让算a^(a^(a^(...))),一共b个a, (mod p)的结果. 思路:这是个幂塔函数,用欧拉降幂公式递归求解. # ...
- j函数 判断以 什么开头
1.str.charAt(index) 返回字符串中指定位置的字符. str 是字符串 我们要将获得的数据 转化为字符串 var code = res.statusCode.toString(); ...
- Python操作cx_Oracle笔记
参考文章: http://cx-oracle.readthedocs.io/en/latest/cursor.html # 创建数据库连接 ordb = Oracle.connect("{0 ...
- 【leetcode】1091. Shortest Path in Binary Matrix
题目如下: In an N by N square grid, each cell is either empty (0) or blocked (1). A clear path from top- ...
- LeetCode--049--字母异位词分组(java)
给定一个字符串数组,将字母异位词组合在一起.字母异位词指字母相同,但排列不同的字符串. 示例: 输入: ["eat", "tea", "tan&quo ...
- 阿里云Serverless应用引擎(SAE)3大核心优势全解析
软件发展到今,企业业务系统日趋复杂,开发一个业务系统需要掌握和关注的知识点越来越多.除实现业务逻辑本身,还需考虑很多非业务的基础技术系统:如分布式cache和队列.基础服务能力集成.容量规划.弹性伸缩 ...
- C# windows窗口应用程序切换主界面的显示内容
不知道说清楚没有?就是我的窗口分为两部分,左边,控制部分,由一些按钮组成右边,显示部分,由些控件(如下拉,文本等等组成) 左边的每个按钮对应显示部分的页面,也就是说,左边换一个按钮点,那么右边就显示其 ...
- mybatis获取数据库自增id
http://blog.csdn.net/dyllove98/article/details/8866357 http://www.iteye.com/problems/86864 insert标签中 ...
- python测试redis是否可以使用
前提打开redis服务,windows打开方式到redis的安装目录命令行输入redis-server from redis import StrictRedis redis = StrictRedi ...