Header Removal Policy
In this tutorial we will demonstrate how can we apply the Header Removal Policy In Mule using API manager. API Manager supports policies for removing HTTP headers from a request or response. The policies take effect before sending the request or response. The Header Removal policy performs the following actions:
- Prevents receipt of one or more specified headers sent from the client to the backend service.
- Prevents inclusion of one or more specified headers in a response from the backend service to the client.
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 Status of the API will be Active
Now we will apply the policy
Select Header Removal
Now update the policy configuration
Have to add following
- Inbound Header Map – header key in String or Regex
- Outbound Header Map – header key in String or Regex
Lets add the required header we want to remove
Now if I hit this API with inHeader as HTTP header
We can see the inHeader is removed from HTTP request’s headers