Senin, 17 Juni 2019

Unexpected end of json input in Node.js

Again, something that I have to keep in my blog.

I am developing a REST API, that decrypts an array of encrypted text. I post the array data in form of JSON data and nodejs keeps giving me an error "unexpected end of json input". But if I check the JSON data, everything looks fine.

stackoverflow saves my live again.

The explanation and the solution is shown in that link. Check the solution using "chunk"