【发布时间】:2017-04-26 08:55:04
【问题描述】:
我正在使用 WSO2 ESB 向我的 Rest API 发送 POST 请求。 实际上,API 返回带有一些数据的 201 状态。 使用 POSTMAN 的 API 本身运行良好,但使用 ESB 链接返回 202 接受的响应 这是我的实现: POST API 链接: http://mysite/sites/4/floors/4/pois/12/prelock
我的 ESB API:
<resource methods="POST" uri-template="/sites/{siteId}/floors/{floorId}/pois/{poiId}/prelock">
<inSequence>
<log level="full"/>
<header name="Content-Type" scope="transport" value="application/json"/>
<property expression="$axis2:HTTP_SC" name="Status" scope="default" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<send>
<endpoint key="NodeRedPrelock"/>
</send>
</inSequence>
<outSequence>
<log level="full"/>
<send/>
</outSequence>
<faultSequence/>
</resource>
端点:
<endpoint name="NodeRedPrelock" xmlns="http://ws.apache.org/ns/synapse">
<http method="post" uri-template="http://mysite/sites/{uri.var.siteId}/floors/{uri.var.floorId}/pois/{uri.var.poiId}/prelock"/>
【问题讨论】: