Clean request body

Hi Apigee Community,

I want to make sure that only a select number of fields from the request body are sent to the target server. I wanted a solution that is both light and easy to maintain, preferably with the allowed fields definition centralized on only one location.

Example:

Allowed fields = [name, surname, date_of_birth]

request.content = {
	name,
	surname,
	age
}

would turn into:

request.content = {
	name,
	surname
}

What are the best solutions for this?

Thank you in advance.

0 1 117
1 REPLY 1

Not applicable

Javascript is an easy option to do this. You can also use java callout or python callout.

You need to check the fields and delete which is not allowed.