on 12-15-2021 9:00 AM
Hi,
Is possibile to set the option maxBodyLength used by CAP when calling the backend?
Thanks
Sam
You can import follow-redirects to your service implementation and then set maxBodyLength.
const cds = require("@sap/cds");
const followRedirects = require("follow-redirects");
const ExampleService = cds.service.impl(async function () {
const srv = await cds.connect.to("serviceName");
followRedirects.maxBodyLength = 1 * 1024 * 1024 * 1024; //1 GB
...
})
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi matveyma ,
Your solution worked for increasing the maxBodyLength for CAP service calls. But I am curious to know how the 'follow-redirects' plugin is increasing the maxBodyLength. How SAP CAP and follow-redirects are connected to each other?
Instead of using the follow-redirects plugin can we increase the maxBodyLength directly in the CAP application?
Kind Regards,
Harshad
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.