【发布时间】:2017-07-20 04:08:00
【问题描述】:
我使用 WSO2 API Manager 创建了一个 API,添加了我自己的 java Restful 服务作为端点。测试服务端点工作正常。 我正确订阅了 API,但是当使用招摇的方式调用 API 时,它会返回以下正文内容:
<!DOCTYPE html>
<html>
<head>
<title>Apache Tomcat/8.0.45 - Error report</title>
<style type="text/css">
H1 {
font-family:Tahoma,Arial,sans-serif;
color:white;
background-color:#525D76;
font-size:22px;
}
H2 {
font-family:Tahoma,Arial,sans-serif;
color:white;
background-color:#525D76;
font-size:16px;
}
H3 {
font-family:Tahoma,Arial,sans-serif;
color:white;
background-color:#525D76;
font-size:14px;
}
BODY {
font-family:Tahoma,Arial,sans-serif;
color:black;
background-color:white;
}
B {
font-family:Tahoma,Arial,sans-serif;
color:white;
background-color:#525D76;
}
P {
font-family:Tahoma,Arial,sans-serif;
background:white;
color:black;
font-size:12px;
}
A {
color : black;
}
A.name {
color : black;
}
.line {
height: 1px;
background-color: #525D76;
border: none;
}
</style>
</head>
<body>
<h1>HTTP Status 406 - Not Acceptable</h1>
<div class="line"></div>
<p><b>type</b> Status report</p>
<p><b>message</b> <u>Not Acceptable</u></p>
<p><b>description</b> <u>The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers.</u></p>
<hr class="line">
<h3>Apache Tomcat/8.0.45</h3>
</body>
</html>
应该返回一个 application/xml 媒体类型!
这是我调用api后大摇大摆的屏幕截图
这是直接从浏览器调用服务时的响应
我也将响应媒体类型更改为 application/json 但它仍然没有工作。
有人可以帮我解决这个问题吗?
【问题讨论】:
标签: wso2 endpoint api-manager