17 Apr 2025 02:01 AM
In the new HTTP Monitor we're trying to build, we want to monitor an HTTP GET that returns a large json body.
The Execution details show:
"responseSizeInBytes": 62354,
"responseBodySizeLimitExceeded": false,
In the "responseBody" value we can see that the JSON is not fully shown cq. being cut off.
Our current code in the post-execution script:
var responseBody = response.getResponseBody();
if (!responseBody) {
api.fail("Response body is empty!");
}
try {
// 2. Try parsing the JSON
var obj = JSON.parse(responseBody);
api.info("Successfully parsed JSON.");
} catch (e) {
api.fail("Failed to parse JSON: " + e.message);
}
Error we are getting: Failed to parse JSON: Unterminated array literal"
My guess is that this is because the getResponseBody method is limiting to 50 KB as per the documentation:
response.getResponseBody()—Returns the first 50 KB of the response body as a string. To parse the JSON-formatted response into an object, use, for example:
Solved! Go to Solution.
17 Apr 2025 08:52 AM
Hi,
I am not aware about an option to increase the limit from your side, you can open a support ticket asking to increase it, it is not an hardcoded limit.
Meanwhile have you tried the http request action in the workflow app?
24 Apr 2025 02:47 AM
Hi,
Thank you for the reply.
I've not tested the workflow app yet.
I'll try the support ticket approach first and will keep the workflow app as a potential workaround for now.