工程是Spring Boot,使用Maven管理依赖,工程启动之后,使用restful工具通过json来测试rest接口,但是却出现了一个错误
HTTP/1.1 406 Not Acceptable
X-Content-Type-Options: nosniff
Pragma: no-cache
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
Content-Language: zh-CN
Date: Wed, 29 Nov 2017 08:14:37 GMT
X-XSS-Protection: 1; mode=block
Content-Length: 0
Expires: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
解决的办法:
1.可以通过在请求中添加权限信息
2.如果只是做测试,可以把后端的权限验证先关闭
3.添加模拟登陆功能。