Nav

Testing Add and Remove Request Header Policies

To test the execution of policies, follow the steps in this section to apply a policy and use curl, for example curl http://localhost:8081 -vvv to test the policies.

Add Request Header Policy

The procedure for testing the add or remove request header policies assume that you created a mule application that logs the headers received by the backend service.

  1. Apply the add request header policy to add a header as described in the previous section.

  2. Run curl.

  3. Check the log of the backend service to verify that request includes the additional header name and value you configured in step 1.

Remove Request Header Policy

The procedure for testing the remove request header policy assumes that you created a mule application that logs the headers received by the backend service.

  1. Apply the remove request header policy to remove a header as described in the previous section.

  2. Run curl.

  3. Verify that the backend service excludes the extra header by checking the log.

Add Response Header Policy

  1. Run curl.

  2. Check the response to see which headers are being received by the client.

  3. Apply the add response header policy to add a response to the header.

  4. Run curl again.

  5. Verify that the specified header is received.

Remove Response Header Policy

  1. Run curl.

  2. Check the response to see which headers are being received by the client.

  3. Apply the remove response header policy to remove a response from the header.

  4. Run curl again.

  5. Verify that the specified header is removed.