Swaroop
unread,Jun 3, 2024, 6:15:41 AMJun 3Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to KrakenD Community
Hi All,
Can anyone help me in acheiving the conversion of queryParam from input to header when reaching backend url.
I have tried with lua script below in green highlighted colour,but still they are going as queryParams
{
"endpoint": "/api/cat",
"output_encoding": "no-op",
"method": "GET",
"input_query_strings": [
"*"
],
"input_headers": [
"User-Agent",
"Accept",
"X-Access-Token",
"Host",
"X-Tenant-Id",
"x-start-record",
"x-batch-size"
],
"extra_config": {
"modifier/lua-endpoint": {
"allow_open_libs": true,
"pre": "local c = ctx.load(); c:headers('x-access-token', string.sub(c:headers('Authorization'),8)); c:headers('x-tenant-id', c:headers('spid')); c:headers('x-start-record', c:query('x-start-record')); c:headers('x-batch-size', c:query('x-batch-size'));"
}
},
"backend": [{
"encoding": "safejson",
"method": "GET",
"sd": "static",
"url_pattern": "/catlogue",
"host": [
"{{ env "HOST" }}"
]
}
]
}
Thanks
Regards,
Santhiswaroop Chenchu