Tyk v2.2 Documentation Components

  1. Home
  2. Tyk v2.2 Documentation Components
  3. Request 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 key/value 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.