I’m having trouble with AWS API Gateway changing my query parameters. It’s turning %20 into + when it goes to my HTTP backend. This is causing issues for my app.
Have u tried using double encoding? Like %2520 instead of %20? That might trick API Gateway. Also, wondering if you’ve looked into custom authorizers or lambda integrations? They could help preserve original params. What backend are you using? Maybe there’s a workaround on that end?
hey whisperin, i ran into similar probs b4. have u checked ur gateway’s settings? theres sometimes an option to preserve original encoding. if not, u could try using a lambda proxy integration. it lets u handle the raw request, keeping the params intact. worth a shot!
I’ve encountered this issue before, and it can be quite frustrating. One effective solution is to use a VTL (Velocity Template Language) mapping template in your API Gateway integration request. You can set it up to pass the raw query string directly to your backend, bypassing API Gateway’s automatic encoding. Here’s a simple template you could try:
This approach preserves the original encoding of your query parameters. You’ll need to parse this raw string on your backend, but it ensures you receive the exact query parameters as sent by the client. It’s a bit more work, but it gives you full control over parameter handling.