Last active
March 12, 2025 19:07
-
-
Save gszr/e313f0242cdf8bd976d1c88bdc9bb70c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "request-callout", | |
"config": { | |
"callouts": [ | |
{ | |
"name": "callout1", | |
"request": { | |
"url": "http://httpbin.org/anything", | |
"by_lua": "local body = kong.request.get_body() or {}; local id = body.id; if id then kong.ctx.shared.callouts.callout1.request.params.url = 'http://httpbin.org/anything/' .. id end", | |
"method": "GET" | |
}, | |
"response": { | |
"body": { | |
"decode": true | |
} | |
} | |
} | |
], | |
"upstream": { | |
"body": { | |
"forward": false, | |
"custom": { | |
"id": "$(callouts.callout1.response.body.url)" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment