在使用 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的更多相关文章

  1. no suitable HttpMessageConverter found for request type [java.lang.Integer]

    今天在使用Spring Template的时候遇到了这个异常: no suitable HttpMessageConverter found for request type [java.lang.I ...

  2. 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 ...

  3. RestTemplate HttpMessageConverter报错的解决方案no suitable HttpMessageConverter

    错误 no suitable HttpMessageConverter found for response type and content type [text/html;charset=UTF- ...

  4. 【FAQ】Could not extract response: no suitable HttpMessageConverter found for respo

    原因: 1:某些必须传入的参数没传 2:返回对象的接收类型不一致

  5. RestTemplate 微信接口 text/plain HttpMessageConverter

    一.背景介绍 使用 Spring Boot 写项目,需要用到微信接口获取用户信息. 在 Jessey 和 Spring RestTemplate 两个 Rest 客户端中,想到尽量不引入更多的东西,然 ...

  6. Androidannotation使用之@Rest与server交互的JSON数据转换(二)

    开篇 之前的一篇博客:Androidannotation使用之@Rest获取资源及用户登录验证(一):http://blog.csdn.net/nupt123456789/article/detail ...

  7. Spring Boot使用RestTemplate消费REST服务的几个问题记录

    我们可以通过Spring Boot快速开发REST接口,同时也可能需要在实现接口的过程中,通过Spring Boot调用内外部REST接口完成业务逻辑. 在Spring Boot中,调用REST Ap ...

  8. 004-RestTemplate 使用常见问题

    一.使用 同前三节:ClientGetGoodsByGoodsIdResponse response = restTemplate.postForObject(svcUrl, request, Res ...

  9. RestTemplate 使用中的几个问题

    Spring Boot使用RestTemplate消费REST服务的几个问题记录 我们可以通过Spring Boot快速开发REST接口,同时也可能需要在实现接口的过程中,通过Spring Boot调 ...

随机推荐

  1. linux基础开发软件安装 - java相关

    1.linux在线安装mysql:转自 https://www.cnblogs.com/bigbrotherer/p/7241845.html ,写的很好,简单易用. 开启远程访问:转 https:/ ...

  2. 逐行读取txt文件,分割,写入txt。。。上传,下载

    s = [] f  = open('querylist.txt','r') #由于我使用的pycharm已经设置完了路径,因此我直接写了文件名 for lines in f:     ls = lin ...

  3. 行人重识别(ReID) ——数据集描述 Market-1501

    数据集简介 Market-1501 数据集在清华大学校园中采集,夏天拍摄,在 2015 年构建并公开.它包括由6个摄像头(其中5个高清摄像头和1个低清摄像头)拍摄到的 1501 个行人.32668 个 ...

  4. linux安装 inotify

    [root@rsync-client-inotify ~]# yum install make gcc gcc-c++ [root@rsync-client-inotify ~]# wget http ...

  5. 测试员小白必经之路----常见的linux操作命令

    linux作为服务器操作系统 linux具有自己的优势,安全.稳定.免费.占有率高 操作系统发展历史 unix>minix>linux linux命令的基本使用 查阅命令帮助信息 comm ...

  6. RABBITMQ 协议 AMQP协议

    https://baike.baidu.com/item/rabbitmq/9372144?fr=aladdin https://github.com/CopernicaMarketingSoftwa ...

  7. yum软件包管理

    一.yum常用命令 #yum -y install [软件包名] //安装 #yum erase [软件包名] //卸载 #yum clean all //清除缓存 #yum makecache // ...

  8. 求能粘贴Word 内容(含图片)的在线编辑器

    word图片转存,是指UEditor为了解决用户从word中复制了一篇图文混排的文章粘贴到编辑器之后,word文章中的图片数据无法显示在编辑器中,也无法提交到服务器上的问题而开发的一个操作简便的图片转 ...

  9. Integrating .NET Code and SQL Server Reporting Services

    SQL Server Reporting Services versions 2000 and 2005 (SSRS) has many powerful features. SSRS has a w ...

  10. [luogu]P1169 [ZJOI2007]棋盘制作[DP][单调栈]

    [luogu]P1169 [ZJOI]棋盘制作 ——!x^n+y^n=z^n 题目描述 国际象棋是世界上最古老的博弈游戏之一,和中国的围棋.象棋以及日本的将棋同享盛名.据说国际象棋起源于易经的思想,棋 ...