Header Injection Policy
Header Injection policy adds headers to a request or response
To Start with we will create an mule application and connect it with API manager – please see how we can connect the mulesoft application to API Manager
After deployment in Cloudhub the API manager configuration will come as Active
Now we will apply the policy
Select Header Injection
Now update the policy configuration
Information needed
- Inbound Header Map – Key-value pair for injecting headers at the beginning of the message processing
- Outbound Header Map – Key-value pair for injecting headers at the end of the message processing
Lets add the required header
Click apply
Now if I hit this API then I’ll get outHeader as HTTP header in response
To see if we are getting header in request, we will add a logger to log the received headers
Now we can see the header in request as well
Sample mule application – sample-rest-service-header-injection
SOAP UI application – sample-rest-service-header-injection-soapui-project