Skip to content

isBase64Encoded field missing from APIGatewayProxyResponseEvent #46

Closed

Description

@dsilvasc

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?

Activity

  1. miere commented on May 11, 2018

    @miere
    Contributor

    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.

  2. miere commented on May 14, 2018

    @miere
    Contributor

    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.

  3. michaelwiles commented on Sep 12, 2018

    @michaelwiles

    Please can this be merged...

  4. bmoffatt commented on Feb 21, 2019

    @bmoffatt
    Contributor

    merged #48

  5. jchapelle commented on Nov 4, 2020

    @jchapelle

    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 ?

  6. added a commit that references this issue on Nov 8, 2023
  7. added a commit that references this issue on Nov 8, 2023
  8. added a commit that references this issue on Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions