SAP BTP Small Talk: Changing the HTTP Response Code within an iFlow
In this short SAP BTP Small Talk note, I’d like to demonstrate how a developer can change the HTTP response code of an integration flow from within the iFlow itself, without applying any API policies.
Scenario
Let’s say you have an iFlow and a proxy that triggers this iFlow.

According to one of the business requirements, you need to change the HTTP response code of the API to a non-standard value. To achieve this, you can either implement the corresponding policies for the API or implement the logic directly within the integration flow. Below is a description of how the latter can be done.
Implementation
To return a custom HTTP response code, the developer needs to overwrite the value of the CamelHttpResponseCode
header parameter.
See Headers and Exchange Properties Provided by the Integration Framework
This can be done by adding a Content Modifier step to the iFlow. In the Message Header tab, create a header parameter named CamelHttpResponseCode
and assign it the desired HTTP status code value.

Testing
In the video fragment below, I trigger the proxy that calls the iFlow, manipulating the value of a custom header parameter, which in turn affects the behavior of the iFlow.