awslabs / awslabs/aws-lambda-cpp
Lambda return types through HTTP API Gateway - only json array or json object are working , else error 500
- Langage dominant
- C++
- Étoiles
- 465
- Forks
- 98
- Merge moyen
- 12 h 47 min
- PR mergées (30 j)
- 3
Description
I'd like to return binary data through the HTTP API Gateway (HTTP , NOT REST API!), but the response has to be a json object, always. Is there some workaround to make that happen like it is possible for the REST API ?
```
#include
using namespace aws::lambda_runtime;
static invocation_response my_handler(invocation_request const& req)
{
return invocation_response::success("binarygoeshere", "application/zip");
}
int main()
{
run_handler(my_handler);
return 0;
}
```
^this returns error code 500
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par invocation_response::success et le chemin de run_handler présenté dans l’exemple, puis suivez la manière dont la réponse est sérialisée pour HTTP API Gateway. Vérifiez si les tests existants de sérialisation des réponses couvrent les payloads non-JSON. Le travail est terminé lorsqu’une méthode prise en charge pour permettre aux données binaires de type de contenu application/zip d’éviter la réponse HTTP 500 a été établie et testée.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- aws, cpp
- Domaine
- api, cloud
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 35/100