码迷,mamicode.com
首页 > 编程语言 > 详细

SpringMVC---REST POST时出现415 Unsupported Media Type

时间:2016-06-19 11:28:24      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:

需要在pom.xml中加jackson依赖
    <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jettison</artifactId>
            <version>${jersey.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jackson</artifactId>
            <version>${jersey.version}</version>
        </dependency>

ContentType设置成application/json

SpringMVC---REST POST时出现415 Unsupported Media Type

标签:

原文地址:http://www.cnblogs.com/beast-king/p/5597528.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!