question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fail to get binary data.

See original GitHub issue

(Region : ap-northeast-2, seoul)

What I did

  1. Set API Gateway Binary Support, case of Conetent-type : application/octet-stream.
  2. Add binary types parameter on createServer from aws-serverless-express
  3. Set request header Accept with application/octet-stream.
  4. Send binary data like res.send(data);. I checked isBase64Encoded is true.

What I expected

I expected to got binary data that decoded by api gateway

What I actually got

I got base64 encoded values.

And also, when I revert commit b61d288 , I could get binary data.

What’s wrong with me?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:11

github_iconTop GitHub Comments

2reactions
jappjacommented, Jan 30, 2017

It’s true that isBase64Encoded flag is not documented for output but it’s discussed e.g. here: https://forums.aws.amazon.com/thread.jspa?messageID=759454

“For the Lambda proxy case, you can send the base64 encoded flag with your response from Lambda to tell API Gateway if your response body is base64 encoded, however, you need to send an Accept header which is defined in the binaryMediaTypes in order to receive a binary response from API Gateway”

0reactions
brettstackcommented, Jul 5, 2018

Don’t do this res.setHeader('isBase64Encoded').

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fail to get binary data. · Issue #39 · vendia/serverless-express
I checked isBase64Encoded is true . What I expected. I expected to got binary data that decoded by api gateway. What I actually...
Read more >
download binary data error | OutSystems
download binary data error. Question. When trying to download attachments i get the following error. When i download the file it returns 0 ......
Read more >
How to fix the error "String or binary data would be truncated"
To fix this error, patch to SQL Server 2016 SP2, CU6 or newer (including SQL Server 2017), and then turn on trace flag...
Read more >
Try to read data from binary file, failed to put it in struct
I read one line into a string and wrote it into the binary file. I'm thinking that that was the problem and now...
Read more >
Why am I getting a 'Binary provider has no content for' error?
A physical binary file is inaccessible or not present in the filestore. A misconfiguration of your binarystore.xml can result in Artifactory ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found