postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.86k stars 841 forks source link

Programmatic File Uploads #5147

Open chrisdeso opened 6 years ago

chrisdeso commented 6 years ago

Is your feature request related to a problem? Please describe. Currently, it isn't possible to programmatically upload files using Postman. There is a workaround but the inability to leverage the Postman UI when editing the file location isn't ideal – File uploads using Newman.

Describe the solution you'd like The ability to define file uploads via the Pre-Request and/or Test script would be great.

Additional context This may be a duplicate feature request so feel free to close/merge as needed.

GarryLowther commented 5 years ago

We are having the same problem and do not want to have to use Newman as this is just another complication. If file upload functionality works when running from the workspace, it should work in the collection runner AND the monitor. Are you planning on fixing this?

ty-meador commented 4 years ago

It's getting close to 2021 here guys. Would you all consider an interim work-around where tests that include file-uploads aren't shared with others? For those of us working alone (like students) there's literally no reason for this to not work. Instead, we're in a position where no one can use it because it won't work for shared runners. What about un-shared runners? Would having 2 types of runners be a descent interim option?

ty-meador commented 4 years ago

It's getting close to 2021 here guys. Would you all consider an interim work-around where tests that include file-uploads aren't shared with others? For those of us working alone (like students) there's literally no reason for this to not work. Instead, we're in a position where no one can use it because it won't work for shared runners. What about un-shared runners? Would having 2 types of runners be a descent interim option?

Ignore me. I just found the newman solution. I like newman better than the GUI runner.

Malachov commented 2 years ago

I faced the same issue as i couldn't test my application. I tried documented body with mode: raw, I tried mode: file as in normal requests in collection Json, no success. Finally I found workaround that is not documented. If I used just string in body, no structured Json

body: "Test",

in pm.request it works. If it's string file like .txt or .md you can load the content in JS and append directly to body.

MohammadAbbas2 commented 2 months ago

Still open in 2024?