Limit CSV response body

I have a response in the form of csv i use the following to capture the csv response, is there a way to limit the lines of csv that are responded

the csv response is very large 1gb, and uses allot of the memory and takes a while to appear.

//capture response from csv content and parse
const input =pm.response.text();
const records = parse(input, {
columns: true,
skip_empty_lines: true,
})

Hi @a12rfx, Welcome to the Community!

I would suggest to limit the response from API itself rather than after getting the response.

Please check the API documentation if it provides any possible way to do pagination or limit the number of lines in response.

1 Like