zoukankan      html  css  js  c++  java
  • HTTP Status 406 --- not acceptable according to the request "accept" headers

    The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers.

    使用以下方案解决

    springmvc json配置方案

    Spring4.1.0

    使用<annotation-driven />MVC配置方法。

    在pom.xml中增加

     1      <dependency>
     2             <groupId>com.fasterxml.jackson.core</groupId>
     3             <artifactId>jackson-core</artifactId>
     4             <version>2.4.3</version>
     5         </dependency>
     6         <dependency>
     7             <groupId>com.fasterxml.jackson.core</groupId>
     8             <artifactId>jackson-databind</artifactId>
     9             <version>2.4.3</version>
    10         </dependency>
    11         <dependency>
    12             <groupId>com.fasterxml.jackson.core</groupId>
    13             <artifactId>jackson-annotations</artifactId>
    14             <version>2.4.3</version>
    15         </dependency>

    controller方法中增加@org.springframework.web.bind.annotation.ResponseBody注解

    可以解决标题中的问题

  • 相关阅读:
    python播放音频文件
    安装pyaudio
    给 python工程 打包并上传 PyPI (The Python Package Index)
    python怎么import自己写的包
    pip源使用国内镜像
    Git和GitHub
    nginx的日志轮转
    ab接口压力测试工具
    nginx 性能优化
    https协议
  • 原文地址:https://www.cnblogs.com/javaleon/p/4023842.html
Copyright © 2011-2022 走看看