How to get a JSON response ?

Not applicable

Hi, I am getting string response of payload, while hitting a lambda function. I have used "resp.end(data.payload)".

If I use "res.json(JSON.parse(data.Payload))" it shows JSON object not found something like that. Please provide me with some example to get the JSON response and the necessary modules to be included.

0 1 1,161
1 REPLY 1

Is this in Apigee?

If you are using a JS callout, you can use:

var responseObject = JSON.parse(context.getVariable("response.content"));