Truncated response body when large data return back to RestResponseV2 in RestMessageV2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2024 01:41 AM - edited ‎01-06-2024 01:48 AM
Hi,
I'm trying to find posts or documentation related to maximum data response size that an instance can receive from the request. Currently I have an script include which will call an external server and that external server returns very big data. Here is the example codes, after receiving big data like in the code the body only receive half content of that full 30MB ~ 40MB which means my data get from the external server is truncated compare to postman response. Due to not completed JSON the error "Error executing script : SyntaxError: Unterminated string literal (sys_script_include.d2426c9ec0a8016501958bf2ac79c775.script; line 155)" occurs when I use JSON.parse().
I wonder if there is any system property reduce my large body RestMessageV2 API calling.
var request = new sn_ws.RESTMessageV2();
request.setEndpoint(externalURL);
request.setHttpMethod('GET');
var res = request.execute();
var body = res.getBody() // Receive an JSON string which has more than 30k records. Size of these requests are approximately 30MB ~ 40MB each call.
var parseBody = JSON.parse(body);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2024 02:24 AM
please find the requested information at https://docs.servicenow.com/bundle/utah-integrate-applications/page/administer/flow-designer/referen...
Maik