Mule - How to do a choice/when based on http response codes?

前端 未结 2 1694
予麋鹿
予麋鹿 2021-01-28 15:35

I need to be able to perform certain actions based on the http response code I get back from an http outbound endpoint. For instance if I get a 500 error or a 302 redirect or a

2条回答
  •  甜味超标
    2021-01-28 16:27

    You can get the HTTP response code with the following expression right after the HTTP outbound endpoint:

    #[message.inboundProperties['http.status']]
    

    Likewise in a Groovy script:

    message.getInboundProperty('http.status')
    

提交回复
热议问题