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

360
Visualizações
Returning a default value using AWS API Gateway

I need to provide some sort of REST API backed by a S3 bucket. The requirement is simple: given a certain key, it should return the contents of the file whose name is that key. If no such file is found in the bucket, then return a default content. In both cases, the response status code should be 200, because the client should not care where the result came from.

This requirement is so simple that I was trying to accomplish this without writing any code. So I tried to put an API created by Amazon API Gateway in front of the S3 bucket. But even though in the "Integration Response" section you can map a "HTTP status regex" to a "Method response status", apparently the same "Method response status" can't appear twice. So, I cannot have a default mapping to 200 while mapping 404 responses also to 200 with a custom body mapping template.

Is it possible to do this using only API Gateway?

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

If the only thing limiting you is number of available responses you can use 203 (forwarding content from the origin) as another successful response. Or you can write a simple lambda function behind your API Gateway to craft the response.

about 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