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 200. I need a way to evaluate the 500, 302, 200. I know how to use Choice-When, but don't know how to access the response code using groovy or whatever you suggest.
相关问题
- Angular RxJS mergeMap types
- Google Apps Script: testing doPost() with cURL
- How to instantiate Http service in main.ts manuall
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- PHP Empty $_POST
相关文章
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- Is a unicode user agent legal inside an HTTP heade
- git: retry if http request failed
- Flutter - http.get fails on macos build target: Co
- C# HttpClient.SendAsync always returns 404 but URL
- Response body is null, status is 200
- Returning plain text or other arbitary file in ASP
- jquery how to get the status message returned by a
Seba is right but that is not enough.
By default, if an client or server error is detected in an HTTP outbound interaction (ie response code >= 400), Mule will treat the response as an error and will break the flow execution and call the exception strategy to deal with the error.
You need to deactivate this behaviour before doing the HTTP outbound interaction in order to have the rest of the flow (your
choice
router) be called. So you need this:before your HTTP outbound endpoint.
You can get the HTTP response code with the following expression right after the HTTP outbound endpoint:
Likewise in a Groovy script: