Tyk v2.2 Documentation Components

HomeTyk v2.2 Documentation ComponentsRequest Body: Form Data

Request Body: Form Data

It is possible to work with inbound form data by making use of the Context Variable feature built into tyk. If context variables are enabled in your API definition, then it is possible to iterate through form or querystring data in your template.

You do this by using the ._tyk_context. namespace, unlike the context exposed to the URL Rewriter and header injector, the body transform can fully iterate through list indices, so for example calling _tyk_context.request_data.variablename[0] in a template will expose the first entry in the request_data.variablename k/v pairing.

The request_data section is populated if the inbound request contained any query data or form data, it will be available in this object as a key:[]value map.

Was this article helpful to you? Yes No