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调 ...
随机推荐
- HTTP 几种常用的认证机制
HTTP Basic Auth HTTP Basic Auth简单点说明就是每次请求API时都提供用户的username和password,简言之,Basic Auth是配合RESTful API 使 ...
- HashMap、Hashtable和ConcurrentHashMap的区别
HashTable 底层数组+链表实现,无论key还是value都不能为null,线程安全,实现线程安全的方式是在修改数据时锁住整个HashTable,效率低,ConcurrentHashMap做了相 ...
- 比较两个Sql数据库是否相同
1.打开VS20122.SQL→架构比较→新建架构比较3.在源和目标上分别填上两个待比较的数据库的信息4.点击比较,不一会儿,系统就会列出两个数据库的差异了.
- GDB学习笔记
GDB是UNIX及UNIX-like下的调试工具.GDB这个调试工具相比于VC.z的优点是具有修复网络断点以及恢复链接等功能. 一.功能 一般来说,GDB主要帮助你完成下面四个方面的功能: 1.启动你 ...
- 【容器化】容器技术实践.pdf_视频学习笔记
容器运行时 docker rkt gvisor containerd 容器编排系统:kubernetes (简称k8s)
- alert(1) to win 6
function escape(s) { // Slightly too lazy to make two input fields. // Pass in something like " ...
- Redis安装配置以及开机启动
1.下载源码,解压缩后编译源码. $ wget http://download.redis.io/releases/redis-2.8.3.tar.gz $ .tar.gz $ cd redis- ...
- 解决 pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' ([Errno 61] Conne
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' ([Errno 61] ...
- html+js(swiper.js)+css左右滑动切换页面效果,适配移动端
demo: 截图: 结构:1.swiper-progress.html2.css文件夹 -swiper.css -swiper.min.css 3.js文件夹 -swiper.min.js -swip ...
- activity_main.xml 添加自己画的view 组件
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android=" ...