Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

794
Visualizações
Can AWS API Gateway support `application/x-www-form-urlencoded` with body and query string parameters?

Numerous services can accept query string parameters in the URL when a POST request is made with Content-Type: application/x-www-form-urlencoded and other parameters in the body, but it seems AWS API Gateway cannot while also accepting query string parameters.

When I call the AWS API Gateway with a POST Mapping Template for application/x-www-form-urlencoded and query string URL parameters (with a Lambda function), I get the following error:

{
  "message":"When Content-Type:application/x-www-form-urlencoded,
    URL cannot include query-string parameters (after '?'):
    '/prod/webhook?inputType=wootric&outputType=glip&url=...'"
}

Here is an example cURL:

curl -XPOST 'https://{myid}.execute-api.{myregion}.amazonaws.com/prod/webhook? \
inputType=wootric&outputType=glip&url=https://hooks.glip.com/webhook/ \
11112222-3333-4444-5555-666677778888' \
-d "@docs/handlers/wootric/event-example_response-created.txt" \
-H 'Content-Type: application/x-www-form-urlencoded' -v

The specific goal is to get a Wootric webhook event posted to a Lambda function using a URL with query string parameters.

You can get the code here:

https://github.com/grokify/chathooks

The Wootric event body file is here:

https://raw.githubusercontent.com/grokify/chathooks/master/docs/handlers/wootric/event-example_response-created.txt

The GitHub issue is here:

https://github.com/grokify/chathooks/issues/15

The error message seems pretty definitive but I wanted to ask:

  1. Is there a workaround to configure an API Gateway to support both?
  2. Is there a standards-based reason why AWS would not support this or is this just a design decision / limitation?

If there's no solution to this, is there a good lightweight solution other than deploying a hosted server solution like Heroku. Also, do other cloud services support this with their API gateway + cloud functions, like Google?

Some examples showing support for both:

  • jQuery example: jQuery send GET and POST parameters simultaneously at AJAX request
  • C# example: Accessing query string variables sent as POST in HttpActionContext
over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Yes,there is a workaround and the key issue is to set the mapping template that will convert string into json . Very detailed example shown in API Gateway any content type.

over 4 years ago · Santiago Trujillo Relatório

0

Please set the request property as "Content-Type", "application/json" for your HttpURLConnection like below connection.setRequestProperty("Content-Type", "application/json");

over 4 years ago · Santiago Trujillo Relatório

0

I had a similar problem, with a 3rd party provider using web hooks. It turns out that my provider is transforming the url path from UPPERCASE to LOWERCASE. Example the endpoint should be apigateway.com/dev/0bscur3dpathRANDOM instead apigateway.com/dev/0bscur3dpathRANDOM. You get the point.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda