Reputation: 307
In my case, while calling the process API from Postman, I'm passing the required headers from Postman itself. Now, the API has two sequential back-end calls, both require same headers. The headers are working fine for the first back-end call. For the second back-end call, I'm getting "Authorization error : Missing Credentials".
I want to use same headers for both back-end calls.
How do I save the incoming headers and pass them to the second back-end call?
Upvotes: 1
Views: 902
Reputation: 3441
Save the transport headers before the first call into a property like below. This would save the property in the message context. $trp indicates that we are reading the incoming transport headers.
<property expression="$trp:Authorization" name="AuthorizationCode" scope="default"/>
After the first call is made, put back the transport header. $ctx means that we are reading from the message Context. We are saving it with the scope transport because we want it to be sent as a Transport Header.
<property expression="$ctx:AuthorizationCode" name="Authorization" scope="transport"/>
Upvotes: 2