【问题标题】:wso2 api manager PUT method does not work in api storewso2 api manager PUT方法在api store中不起作用
【发布时间】:2016-06-07 17:11:07
【问题描述】:

Wso2 API 管理器 1.10.0。 PUT 方法在 API 存储中不起作用。 GET、POST、DELETE 方法有效,但 PUT 无效。

错误,

Curl

curl -X PUT --header "Content-Type: application/json" --header "Accept: application/json" --header "Authorization: Bearer c6c90338514e561c8a02a7b6a1c96553" -d "{\"payment\":\"PAID\"}" "https://10.138.31.22:8243/Starbucks_API/1/order_1"

Request URL

https://10.138.31.22:8243/Starbucks_API/1/order_1

Response Body

<ams:fault xmlns:ams="http://wso2.org/apimanager/security">
  <ams:code>900906</ams:code>
  <ams:message>No matching resource found in the API for the given request</ams:message>
  <ams:description>Access failure for API: /Starbucks_API/1, version: 1. Check the API documentation and add a proper REST resource path to the invocation URL</ams:description>
</ams:fault>

Response Code
403

Response Headers
{
  "content-type": "application/xml; charset=UTF-8"
}

请求中给出的资源实际上是匹配的,我在 API 中提到过。 任何帮助表示赞赏。

资源定义

【问题讨论】:

  • 你能在这里添加你的资源定义作为截图吗?
  • 请在这里找到图片,prntscr.com/bdamuo
  • 我无法在本地重现您的错误。
  • 连我都看不懂,因为资源定义正确,其他方法都行,只有Put不行。
  • 无论如何,你已经用两个 HTTP 方法定义了相同的 URL,这是我发现的另一个问题。

标签: wso2 wso2-am


【解决方案1】:

您有两个具有相同 URL 的 PUT。不能有两个不同的 HTTP 资源具有相同的 URL。

【讨论】:

  • 我很困惑。是的,我们不能有两个具有相同 URL 的不同 HTTP 资源。实际上,我可以使用一个 PUT 请求执行所有更新。感谢您强调这一点。
猜你喜欢
  • 2019-12-09
  • 1970-01-01
  • 2021-09-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-05-30
相关资源
最近更新 更多