I am automating my API testing using Postman and Newman. I'd like to automate the process of uploading a file to my API, however before the file gets uploaded it needs to be altered.
I can see how a file can be uploaded automatically, however I cannot see how I can first amend the file then upload it.
How do I create a custom file, then upload it in Postman?
I see the possible options as the below, however I'm unsure how to execute them.
Option 1 - Create a File To Upload
- Create a new CSV file in the pre-request script
- Save the file
- Reference the file and upload it
Option 2 - Create the file content then upload
- Create the CSV file content
- Upload the file content and make it look like a file