我尝试RESTful到RESTful映射。我的终点是http://localhost:8080/get_weather/uk/London
我将它映射到
<api name="API_1" context="get_weather" hostname="http://localhost" port="8080">
<resource method="GET" uri-template="/{p1}/{p2}/">
<inSequence>
<log level="custom">
<property name="param1" expression="get-property('uri.var.p1')" />
<property name="param2" expression="get-property('uri.var.p2')" />
</log>
<send>
<endpoint key="http://samples.openweathermap.org/data/2.5/weather?q{param2},{param1}" />
</send>
</inSequence>
</resource>
</api>
这是资源的源视图,
curl
最后我将使用curl -i -H "Accept: application/json" -X GET http://localhost:8080/get_weather/uk/London
来发出请求
endpoint
如何在https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/css/materialize.min.css
中使用已记录的参数?
答案 0 :(得分:0)
尝试这样的事情:
<send>
<endpoint>
<http method="GET" uri-template="http://samples.openweathermap.org/data/2.5/weather?q={uri.var.p2},{uri.var.p1}"/>
</endpoint>
</send>