Express: Empty response

Created on 11 Feb 2020  路  2Comments  路  Source: expressjs/express

Hello, I have a server to which you send a photo and a parameter (level), this is responsible for dividing the photo into as many pieces as the level specified. Each piece of the photo in part of an array. To send it to the client I convert all the pieces into base64.

Screenshot

On line 22 the information is displayed by console correctly, but on line 23 the answer is empty

Screenshot

I've tried with res.send (), res.json () and res.send ({})

awaiting more info question

Most helpful comment

It's possible it is the JSON serialization of your object. Can you change console.log(imagesEncoded) to console.log(JSON.stringify(imagesEncoded)) to see if that outputs what you are expecting? That will narrow down if it is an Express issue or a JSON serialization of your object issue.

All 2 comments

It's possible it is the JSON serialization of your object. Can you change console.log(imagesEncoded) to console.log(JSON.stringify(imagesEncoded)) to see if that outputs what you are expecting? That will narrow down if it is an Express issue or a JSON serialization of your object issue.

Yes, it seems to be that, when I run console.log (JSON.stringify (imagesEncoded)) the response in console is [{}, {}, {}, {}].
Thank you so much, I would not have occurred this problem.

Was this page helpful?
0 / 5 - 0 ratings