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

Header Injection Policy


Select Header Injection

Header Injection Policy


Now update the policy configuration

Header Injection Policy


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


Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.

Share this:
Notify of
Inline Feedbacks
View all comments