I need to run the test case by reading data from an external CSV data file(By uploading the data file from collection runner). I'm able to read the values of an external CSV file in 'pre-request script' as well as in 'tests'. But facing difficulty to read the file in POST API request body. How to read and replace the input in API request body?
I tried below things to read in the request body.
To access values of 'Summer' column I used
data.columnName i.e data.Season
pm.iterationData.get(columnName) i.e pm.iterationData.get("Season")
Both of them could not fetch the value. Whereas if I run the same code in 'pre-request script' Or in 'tests', the statements were successfully fetching the values. Please help me to access the content of datafile in the request body.