0

I want to send and receive a javascript object through a POST request parameter. As a result, I need to find a solution to encode and decode it.

JSON.stringify() won't work because my JS object may contain functions.

I am also trying to avoid the option of sending it as a file, as it would introduce extra complexities, like introducing module.exports and require on sending and receiving sides respectively.

Any possible solution for my problem?

Jimut
  • 195
  • 3
  • 13
  • 1
    You can't send functions through the internet. – euvl Jul 28 '17 at 09:20
  • "my JS object may contain functions" — This is almost always a really bad idea. Design a data format to remove the need to do that if you can. – Quentin Jul 28 '17 at 09:22

0 Answers0