Write a jq request programv2.6+

Write a jq request program. In this example, this simple jq program takes the name James Dean in the request and rewrites it to John Doe.

Set up the plugin

Make the following request:

curl -i -X POST http://localhost:8001/plugins/ \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data '
    {
      "name": "jq",
      "config": {
        "request_jq_program": "select(.name == \"James Dean\").name = \"John Doe\"\n"
      }
    }
    '
Copied to clipboard!

Did this doc help?

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!