WSO2 API 经理 - API 定义 URL 映射

WSO2 API Manager - API Definition URL Mapping

这是一个简化的 ASP.NET 网页 API

public string Get() {
    return $"Received value: 1,2 in string Get()";
}

public string Get([FromUri] int id) {
    return $"Received value: {id} in Get(int id)";
}

如何将这些映射到 WSO2 API 定义中?我尝试了下面的方法,但它似乎不起作用。

我收到以下错误

{"fault":{"code":900906,"message":"No matching resource found in the API for the given request","description":"Access failure for API: /api/1.0, version: 1.0 status: (900906) - No matching resource found in the API for the given request. Check the API documentation and add a proper REST resource path to the invocation URL"}}

我希望 url 调用这样的东西

http://localhost:8280/api/Default
http://localhost:8280/api/Default?id=123

在此先感谢您的帮助!

您可以为 2 个案例定义 2 个资源。 (即有和没有查询参数)

在您的 URL 中,版本不正确。应该是

http://localhost:8280/api/1.0.0 
http://localhost:8280/api/1.0.0?id=123

如果版本是默认版本,你可以像这样直接删除版本。

http://localhost:8280/api 
http://localhost:8280/api?id=123