Request not sent when payload length is more than 10 MB

Kotha Sowmya
Tera Contributor

Hello Team,

 

We have a requirement to send a request with multiple attachments data ,when are try to hit request we got the below error:

{"error":{"message":"com.glide.rest.domain.UserException: Rejected large REST payload with content-length=14376876 bytes. Max allowed: 10 MB","detail":""},"status":"failure"}

 

Actually we don't see any OOB properties in our instance so we tried by creating a new properties by checking in some of the community pages (glide.size.aware.max_size.org.mozilla.javascript.NativeString -> 83886080 
glide.size.aware.max_size.java.lang.String  - >  83886080)  
still it didn't work.

 

 If we can't increase the property or already over the limit, what will be the best approach for this use-case?

Can you please let us know if there are any ways to split the  transaction request ?

 

Thank you.

1 ACCEPTED SOLUTION

Rajdeep Ganguly
Mega Guru


The error message you're seeing is due to ServiceNow's REST API payload size limit, which is set to 10MB by default. This limit is in place to prevent large payloads from causing performance issues.

Here are some potential solutions:

1. **Split the Attachments**: If the attachments are the cause of the large payload, consider splitting them into multiple smaller requests. This would involve creating a mechanism to split the attachments into smaller chunks, send each chunk as a separate request, and then reassemble them on the server side.

2. **Compress the Data**: If the data being sent is text, it may be possible to compress it before sending. This would involve implementing a compression algorithm on the client side and a corresponding decompression algorithm on the server side.

3. **Use a Different Method**: If the data being sent is not suitable for splitting or compression, consider using a different method to send the data. For example, you could upload the data to a temporary location (like an FTP server or cloud storage), and then send a request to ServiceNow with the location of the data. ServiceNow could then download the data directly.

4. **Increase the Limit**: As a last resort, you could consider increasing the payload size limit. However, this should be done with caution, as it could lead to performance issues. The properties you mentioned (glide.size.aware.max_size.org.mozilla.javascript.NativeString and glide.size.aware.max_size.java.lang.String) are not officially documented by ServiceNow, so their use is not recommended or supported.

Please note that these solutions may require significant development effort and should be thoroughly tested to ensure they do not cause other issues.


nowKB.com

For asking ServiceNow-related questions try this :
For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - https://nowgpt.ai/

For the ServiceNow Certified System Administrator exams try this :
https://www.udemy.com/course/servicenow-csa-admin-certification-exam-2023/?couponCode=NOW-DEVELOPER

View solution in original post

1 REPLY 1

Rajdeep Ganguly
Mega Guru


The error message you're seeing is due to ServiceNow's REST API payload size limit, which is set to 10MB by default. This limit is in place to prevent large payloads from causing performance issues.

Here are some potential solutions:

1. **Split the Attachments**: If the attachments are the cause of the large payload, consider splitting them into multiple smaller requests. This would involve creating a mechanism to split the attachments into smaller chunks, send each chunk as a separate request, and then reassemble them on the server side.

2. **Compress the Data**: If the data being sent is text, it may be possible to compress it before sending. This would involve implementing a compression algorithm on the client side and a corresponding decompression algorithm on the server side.

3. **Use a Different Method**: If the data being sent is not suitable for splitting or compression, consider using a different method to send the data. For example, you could upload the data to a temporary location (like an FTP server or cloud storage), and then send a request to ServiceNow with the location of the data. ServiceNow could then download the data directly.

4. **Increase the Limit**: As a last resort, you could consider increasing the payload size limit. However, this should be done with caution, as it could lead to performance issues. The properties you mentioned (glide.size.aware.max_size.org.mozilla.javascript.NativeString and glide.size.aware.max_size.java.lang.String) are not officially documented by ServiceNow, so their use is not recommended or supported.

Please note that these solutions may require significant development effort and should be thoroughly tested to ensure they do not cause other issues.


nowKB.com

For asking ServiceNow-related questions try this :
For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - https://nowgpt.ai/

For the ServiceNow Certified System Administrator exams try this :
https://www.udemy.com/course/servicenow-csa-admin-certification-exam-2023/?couponCode=NOW-DEVELOPER