# Synthetic ResponseBody too large for JSON parsing

**URL:** <https://community.dynatrace.com/t/synthetic-responsebody-too-large-for-json-parsing/51268>\
**Category:** Developer Q&A Forum\
**Tags:** coding-assistance\
**Created:** [April 17, 2025, 1:01am UTC](https://community.dynatrace.com/t/synthetic-responsebody-too-large-for-json-parsing/51268 "2025-04-17T01:01:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![droogendijk-phl](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@droogendijk-phl](https://community.dynatrace.com/u/droogendijk-phl)\
**Post date:** [April 17, 2025, 1:01am UTC](https://community.dynatrace.com/t/synthetic-responsebody-too-large-for-json-parsing/51268/1 "2025-04-17T01:01:04Z")

</div>

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:

```javascript
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](https://docs.dynatrace.com/docs/observe/digital-experience/synthetic-monitoring/http-monitors-classic/pre-and-post-scripting-for-http-monitors-classic#methods):

```markup
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:

```

Is there a way to successfully JSON parse a responseBody larger than 50 KB?

---

<div class="post-metadata">

**Author:** ![yanezza](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yanezza/32/5036_2.png) [@yanezza](https://community.dynatrace.com/u/yanezza)\
**Post date:** [April 17, 2025, 7:52am UTC](https://community.dynatrace.com/t/synthetic-responsebody-too-large-for-json-parsing/51268/2 "2025-04-17T07:52:55Z")

</div>

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](https://docs.dynatrace.com/docs/analyze-explore-automate/workflows/default-workflow-actions/http-request-workflow-action) in the workflow app?

---

<div class="post-metadata">

**Author:** ![droogendijk-phl](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@droogendijk-phl](https://community.dynatrace.com/u/droogendijk-phl)\
**Post date:** [April 24, 2025, 1:47am UTC](https://community.dynatrace.com/t/synthetic-responsebody-too-large-for-json-parsing/51268/3 "2025-04-24T01:47:17Z")

</div>

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.
