[英]SpringBoot Post works locally but in dev region fails with 415 “Content type 'application/xml;charset=UTF-8' not supported”
I have a springboot Rest service with below request mapping.I need the request and response in XML.我有一个带有以下请求映射的springboot Rest服务。我需要XML中的请求和响应。 When I test "POST" works locally and response received in XML format but in Dev region same request fails with status 415?any thoughts\help?当我测试“POST”在本地工作并且以 XML 格式收到响应但在开发区域相同的请求失败时,状态为 415?任何想法\帮助?
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = {
MediaType.APPLICATION_XML_VALUE }, headers = "Accept=application/xml")
Response I get from Dev region我从开发区得到的回应
{
"timestamp": "2020-04-23T14:49:29.293+0000",
"status": 415,
"error": "Unsupported Media Type",
"message": "Content type 'application/xml;charset=UTF-8' not supported",
"path": "/get"
}
Added below Gradle dependency - implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.10.0'在 Gradle 依赖项下方添加 - 实现 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.10.0'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.