我有一个基本的SpringBoot2.3.4.RELEASE应用程序。使用Spring初始化器,JPA,嵌入式Tomcat;
我想创建此MediaType
MediaType customMediaType = MediaType.parseMediaType("application/json; profile=http://realtime-listings.webservices.zpg.co.uk/docs/v2.0/schemas/listing/list.json");
在PostMan中可以正常工作,但在RestTemplate中不行
ERROR at org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:175)
- Servlet.service() for servlet [dispatcherServlet] in context with path [/zoopla] threw exception [common.exception.BusinessException:
Invalid mime type "application/json; profile=http://test.com/docs/v2.0/schemas/listing/list.json":
Invalid token character ':' in token "http://test.com/docs/v2.0/schemas/listing/list.json"
1条答案
按热度按时间ilmyapht1#
然后,如果postman允许,它就会被破坏,因为
:
在类型中无效。参见RFC 6838和RFC 3986