I am trying to use json.dumps and json.load but getting error
Hello @vishalvekaria19, thank you for reaching to the Apigee forum. Just a quick note to help keep the forum organized - please try to focus on one post per question, as this helps streamline responses and keeps things tidy.
Additionally, it would be helpful if you could provide more details about your issue to help community members to better understand and provide relevant solutions. Thank you 😊
Hey @vishalvekaria19, according to the documentation, Python language support is provided through Jython version 2.5.2, which doesn't have a native JSON module.
You should consider using JavaScript policy if you want to parse JSON objects.
var requestContent = context.getVariable('request.content');
try {
var parsedRequestContent = JSON.parse(requestContent);
} catch (e) {
throw new Error('request content is not a JSON');
}
// Continue with other code using parsedRequestContent
// ...
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |