Skip to content

Instantly share code, notes, and snippets.

@gszr
Created August 1, 2025 11:59
Show Gist options
  • Save gszr/0be007f1b2e1b40f80fd77211380d748 to your computer and use it in GitHub Desktop.
Save gszr/0be007f1b2e1b40f80fd77211380d748 to your computer and use it in GitHub Desktop.
Use full callouts response in upstream request
{
"name": "request-callout",
"config": {
"callouts": [
{
"name": "c1",
"request": {
"url": "https://mocki.io/v1/3b51613b-a7e0-44bf-803a-35f6939e55f3",
"method": "GET"
},
"response": {
"body": {
"decode": true
}
}
},
{
"name": "c2",
"request": {
"url": "https://mocki.io/v1/c5232232-fb9f-4f2d-9835-6b08e2ae005c",
"method": "GET"
},
"response": {
"body": {
"decode": true
}
}
}
],
"upstream": {
"by_lua": "local callouts = kong.ctx.shared.callouts; kong.service.request.set_body({ ['c1-request'] = callouts.c1.response.body, ['c2-request'] = callouts.c2.response.body }, 'application/json')"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment