# Response Processor
This feature is available as part of vREST NG Pro/Enterprise version.
If you want to pre-process the API response before the validation of your test case then vREST provides some built-in response processors and also allows you to write your own custom response processor by using the utility methods.
First, we will see the built-in response processors, and then we will look at how you may write a custom response processor.
vREST provides the following builtin response processors:
This response processor converts the API response into a base64 string. This processor might be useful in validating the binary responses by their base64 equivalent.
This response processor always returns a blank string irrespective of the API response. It is useful in ignoring a large binary/textual response.
This response processor converts the API response into an md5 hash string. This processor is also useful in validating the binary responses by their checksum.
If the API response is CSV content then this response processor converts that CSV content into JSON format.
If the API response is XML content then this response processor converts that XML content into JSON format. This makes validating the XML responses a lot easier.
If the API response is an XLS file then this response processor converts that XLS file into JSON format for further validation.
# Custom Response Processor
You may even write a custom response processor. Let's take a practical example to understand its utility. Suppose your server returns a JSON response but in base64 encoded format. So, in this situation, you may write a custom utility method that will decode the API response first and you may easily validate your API response after that.
Suppose our sample API returns the following encoded API response as shown in the screenshot. For demonstration purposes, the JSON response is only base64 encoded.
Now let's write a custom utility method, which decodes this base64 encoded string into JSON content again. We have specified the utility method named
decodeBase64 as shown below:
Let's use this utility method in our test case to decode the API response. Just specify the utility method name in the
Response Processor field. You can see that now vREST is showing the actual response as a JSON string. Which you may easily validate using JSON response validation.