Testing Request and Response Transformation Policies

You can test request and response transformation policy by invoking the REST API URI in Postman. Specify the REST API URI with the required method in the format as follows:

native endpoint

Let's test the request and response transformation policies applied for the ConsumerAPI example. In this example, to test whether the request and response transformation policies are working as expected, let's the invoke the API endpoint by adding the X-Api-Consumer-Secret header with the API secret key value xyz. The API request should be authorized and retrieve the product information with the customized response.

Before you begin

Ensure that you have Postman installed in your system, or you can you use the web version of Postman.

To test request and response transformation policies using Postman

  1. In the Postman UI, select the HTTP method as GET.
  2. Invoke the endpoint, http://hostname/gateway/ConsumerAPI/1.0/product.
    add url
  3. In the Authorization tab, select the type as Basic Auth and provide the login credentials of the API Gateway instance.
  4. In the Headers tab, provide the following details:
    1. Key: X-Api-Consumer-Secret
    2. Value: xyz
  5. Click Send.
    customized response

    The REST API is successfully invoked, transforming the request and response according to the applied policies for request and response transformation, displaying the customized response along with the product details.