0

I am trying to set a webhook for a payment system. Although, they keep sending invalid JSON data with content-type "application/json" headers.

Since I have set express with app.use(express.json()), whenever they make a POST request I'm unable to parse the data and the server errors.

This is what they're trying to send:

data={
  "return": {
    "orders": [
      {
        "order": {}
      }
    ]
  }
}

As you can see: it's JSON content assigned to a variable.

How do I deal with that, in order to have access to the actual JS object?

jurordrained
  • 131
  • 2
  • 9

0 Answers0