【问题标题】:How to Use Query Params With WSO2 API Manager 1.8?如何在 WSO2 API Manager 1.8 中使用查询参数?
【发布时间】:2015-06-05 14:28:04
【问题描述】:

我正在使用 Wso2 API 管理器 1.8 。我创建了一个 API http://example.com:8280/api/test/v1/user/{userId}/content.json , 这里 userID 值是动态的。正常的 API 调用工作正常,即

http://example.com:8280/api/test/v1/user  /200/content.json ,I am   
getting the results fine.Now I want to apply pagination. I am passing   
some query-params with this ,ie http://example.com:8280/api/test/v1/user
/200/content.json?startIndex=0&count=1

But 403 forbidden error coming .  
<ams:fault>
     <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: /api/streams, version: v3 
     with key: b3672a32d5b152a979cc36cb4de7f9b</ams:description>

为什么会这样?

Here is my api xml source code .   
<resource methods="OPTIONS POST GET"
         uri-template="/user/{userId}/content.json"
         faultSequence="fault">
  <inSequence>

我该如何解决问题。请提出一些解决方案

【问题讨论】:

    标签: wso2 wso2-am


    【解决方案1】:

    这里的问题是您的 URL 与资源模式不匹配。 检查此post 以获取示例

    【讨论】:

      【解决方案2】:

      感谢大家的回复。我已经得到了答案。在创建 API 时,在资源的末尾给出 *,即 /user/{userId}/content.json*。然后它会接受你在结束时提供的任何东西(也是免费的)。

      【讨论】:

      • 幸运的是路径参数后面有“/content.json”。 URL 模式“/user/{userId}*”不适用于 URL /user/200 和 /user/200?startIndex=0&count=1。 WSO2 的任何人都想分享他们的 cmets 吗?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多