Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

358
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda