Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isBase64Encoded field missing from APIGatewayProxyResponseEvent #46

Closed
dsilvasc opened this issue Apr 22, 2018 · 6 comments
Closed

isBase64Encoded field missing from APIGatewayProxyResponseEvent #46

dsilvasc opened this issue Apr 22, 2018 · 6 comments

Comments

@dsilvasc
Copy link

The field isBase64Encoded from https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-output-format is not present in APIGatewayProxyResponseEvent.

It's present in the AwsProxyResponse class from https://github.com/awslabs/aws-serverless-java-container though -- also an Amazon project. Maybe these two projects could share API Gateway data types?

@miere
Copy link
Contributor

miere commented May 11, 2018

I'm facing the same issue. Also, I miss the isBase64Encoded attribute on the request object too.
I think it would be easy to fix. If you guys don't mind I can send you a PR with a patch.

@miere
Copy link
Contributor

miere commented May 14, 2018

Also, I miss the isBase64Encoded attribute on the request object too.

I've overlooked the request object. Indeed, the isBase64Encoded is there.
But, off course, the response object still misses this attribute.

@michaelwiles
Copy link

Please can this be merged...

@bmoffatt
Copy link
Contributor

merged #48

@jchapelle
Copy link

jchapelle commented Nov 4, 2020

I've juste created a lambda returning application/pdf data encoded as base64.

APIGatewayProxyResponseEvent response = new APIGatewayProxyResponseEvent();
            response.setStatusCode(200);
            HashMap<String, String> headers = new HashMap();
            headers.put("Content-Type", "application/pdf");
            response.setHeaders(headers);
            response.setIsBase64Encoded(true);
            response.setBody(base64Document);

In the api gateway logs, I cannot see anywhere isBase64Encoded in the response received from lambda. Where is it supposed to be set ?

My client keeps receiving response from api gateway as base64 encoded string. I would like the data to be sent as binary data.

The Accept header sent by my client contains "application/pdf" as the only one parameters and the mediaType in setting of the api gateway is also "application/pdf" (ven tried it with /).

Could you help ?

dtorok added a commit that referenced this issue Nov 8, 2023
Co-authored-by: Daniel Torok <[email protected]>
smirnoal pushed a commit that referenced this issue Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants