我正在从Mule 4开发一个REST API,并尝试设置响应标头,但是我能够得到完美的答案。
您能帮助我获得解决方案吗?
答案 0 :(得分:0)
您在响应的<http:headers>
元素中设置响应。
示例:
<http:listener path="test" allowedMethods="GET" config-ref="httpConfig">
<http:response statusCode="200" reasonPhrase="Response OK">
<http:headers>
#[{
"key1" : "value1",
"key2" : vars.someValue}]
</http:headers>
</http:response>
</http:listener>