Content type expected:<application/json;charset=UTF-8> but was:<application/hal+json;charset=UTF-8>
来源:互联网 发布:军训合照能上传网络吗 编辑:程序博客网 时间:2024/06/10 04:55
spring boot junit测试时报错
解决方法:
private MediaType contentType = new MediaType("application", "hal+json", Charset.forName("UTF-8"));
@Test public void testGetUsers() throws Exception {mockMvc.perform(get("/api/user")).andExpect(status().isOk()).andExpect(content().contentType(contentType)).andExpect(jsonPath("$.errcode", is(0))).andExpect(jsonPath("$.p2pdata", notNullValue())); }
阅读全文
0 0
- Content type expected:<application/json;charset=UTF-8> but was:<application/hal+json;charset=UTF-8>
- HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported
- Retrofiy学习"Content-Type: application/json;charset=UTF-8"@Body的使用
- Handler execution resulted in exception: Content type 'application/json;charset=UTF-8' not supported
- SPringMVC在使用JSON的数据传输时Error: Content type 'application/json;charset=UTF-8' not supported
- SpringMVC在使用JSON时出现Error: Content type 'application/json;charset=UTF-8' not supported
- client found response content type of text/html charset=utf-8 but expected text/xml
- Okhttp3问题 Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported
- 获取 request 中用POST方式"Content-type"是"application/x-www-form-urlencoded;charset=utf-8"发送的 json 数据
- 获取 request 中用POST方式"Content-type"是"application/x-www-form-urlencoded;charset=utf-8"发送的 json 数据
- (转)获取 request 中用POST方式"Content-type"是"application/x-www-form-urlencoded;charset=utf-8"发送的 json 数据
- AjaxAnywhere content-type in not text/xml : [text/json;charset=UTF-8]
- Content-Type:application/x-www-form-urlencoded; charset=UTF-8 设置方法 针对AFN或者是原生
- header("Content-Type:text/html;charset=utf-8");
- header('Content-Type: text/html; charset=utf-8');
- header('Content-Type: text/html; charset=utf-8');
- header("Content-type:text/html;charset=utf-8")含义
- Content type 'text/plain;charset=UTF-8' not supported
- idea 中使用mongo 客户端 不用开一堆桌面 一个工具全搞定
- form表单下的button按钮会自动提交表单的问题
- 对javascript半包理解
- 轰炸理解深度学习里面的encoder-decoder模型
- vue
- Content type expected:<application/json;charset=UTF-8> but was:<application/hal+json;charset=UTF-8>
- Activity UI界面架构图
- pixhawk视频学习笔记
- 使用QTGraphics View 框架实现地图浏览
- go连接mysql
- Django之Form组件校验de几种方式
- 判断主机是大端还是小段-C语言
- php 二维数组根据某字段去重
- 形状约束——asm