Return file as byte array in Spring Cloud Function on AWS

25 Views Asked by At

How can I return a pdf file using Spring Boot Cloud function? I'm using this code

return new GenericMessage(
                    documentBytes,
                    Map.of(
                            "Content-Type", "application/octet-stream",
                            "statuscode", HttpStatus.OK.value(),
                            "Content-Disposition", String.format("attachment; filename=%s", inputRequestData.getDocumentFileName())
                    )
            );

But it doesn't work (also tried with "Content-Type", "application/pdf"). Thank you

0

There are 0 best solutions below