How to handle request payloads larger than 5MB
Learn how to use the HTTP File Trigger to process payloads exceeding 5MB in your pipeline.
Last updated
Was this helpful?
Learn how to use the HTTP File Trigger to process payloads exceeding 5MB in your pipeline.
Last updated
Was this helpful?
Both REST and HTTP triggers have a payload limit of 5MB. If this limit is reached, the Platform returns the HTTP status "413" with the following message:
Below you can find out more about an alternative method for handling requests that exceed the payload limit.
You can use the HTTP File Trigger to process payloads larger than 5MB by sending the data as a file.
Specify the appropriate content type for your file under Body Upload and Response Content-Types. In this example, the value is application/json
, but it can also be other formats, such as application/pdf
or application/jpeg
.
After receiving the payload with the HTTP File Trigger, you can access the Monitor page to see the Execution Details. Note that the payload is received as a file and not in the body key. In this context, the body key is empty.
Special handling is required to access the uploaded file. A common approach is to store the request’s input data in a Session Management connector, preserving details such as Headers
and QueryAndPath
.
Use the File Reader connector to read the file and convert it into a JSON string. Then, apply the Double Braces TOJSON
function to transform it into a JSON object.
In this example, the conversion takes place in the JSON Generator connector, named "TOJSON data", as illustrated in the image below.
Once you have obtained the desired payload, you need to prepare the pipeline's response. You can return either a .json
file or a JSON object.
To generate a file, use the File Writer connector:
Alternatively, you can use a JSON Generator connector to structure and provide the final response, as shown in the following example: