问题
I am using the Postman Collection Runner to automate a series of API calls. On one of these API calls I need to submit a binary file as the body of a POST. When setting up the Collection Runner I see how to select a file, but I can't figure out how to attach that file to the body of the POST request in the "Pre-request Script".
Is it possible in a "Pre-request Script" to load a binary file into the "data" object?
回答1:
Currently postman collection runner doesn't support file uploads.
You will have to use newman
to execute your Automation Test Suite(collection).
Have a look at this answer: Postman - POST request with file upload
来源:https://stackoverflow.com/questions/45799280/in-postman-how-to-post-binary-file-use-collection-runner