2017-08-14 60 views
2

我正试图处理后端API(REST),没有可以通过Azure APIM访问的swagger文档。 我希望所有针对后端API的调用都不要为所有资源手动创建GET/PUT/POST。我对所有的操作入境政策低于 'Azure APIM作为纯代理服务器

<policies> 
 
    <inbound> 
 
    <set-variable name="requestPath" value="@(context.Request.Url.Path)" /> 
 
    <base/> 
 
    <set-backend-service base-url="https://*****/****/" /> 
 
    <rewrite-uri template="@(context.Request.Url.Path)" copy-unmatched-params="true" /> 
 
    </inbound> 
 
    <backend> 
 
    <base/> 
 
    </backend> 
 
    <outbound> 
 
    <base/> 
 
    </outbound> 
 
</policies>

` 但是打APIM我得到

{ "statusCode": 404, "message": "Resource not found" } 任何帮助表示赞赏感谢

回答

2

易时方法是为每个支持的HTTP方法创建一个操作,并使用/*为模板。这将匹配任何入站路径/查询并将其转发到后端。