usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
25.05k stars 1.14k forks source link

Allow users to upload a raw file as the request body #2700

Open zachary-berdell-elliott opened 1 month ago

zachary-berdell-elliott commented 1 month ago

I have checked the following:

Describe the feature you want to add

Hi, I recently moved from Postman to Bruno and noticed one of the features that was missing is the ability to upload a file as the request body. Having an ability for the user to select raw file as the body then a button that allows the user to pick a file to use would be helpful. I am currently using the fs and path npm packages in the script tab to fullfill this use case but think this feature would make Bruno easier to use. Thanks.

I checked to see if this Issue is already open and didn't find anything but please close if this is already open.

Mockups or Images of the feature

Screenshot 2024-07-24 220624 Screenshot 2024-07-24 220851

Please find these images to support the feature.

EverStarck commented 1 month ago

please

zachary-berdell-elliott commented 1 month ago

I don't mind working on this if needed. May take me a minute since I have mostly been working with Java recently. I've started looking over the code to understand the syntax that is being used and am finding the places I would need to implement the feature.

If someone else knows this repository better though and has the bandwidth then I'll let them pick it up.

zachary-berdell-elliott commented 1 month ago

I've started the implementation. I'll raise a PR if I finish or I'll let someone continue this if someone else picks it up:

https://github.com/usebruno/bruno/compare/main...zachary-berdell-elliott:bruno:feature/add-raw-file-request-body-option

zachary-berdell-elliott commented 1 month ago

Update on development: I have got the feature working. I set up the Google Drive API in GCP to test and I am able to upload documents. I checked in google drive for a docx and it still contains all the text and formatting from when I uploaded it. I'm thinking I'll center and enlarge the button for selecting a file then raise a pr.

Screenshot 2024-08-04 134706 Screenshot 2024-08-04 134812 Screenshot 2024-08-04 134844 Screenshot 2024-08-04 134901

Functionality that hasn't been added yet:

These features can be added in the future unless suggested otherwise during PR review. I want to keep the PR small and easy to review.

zachary-berdell-elliott commented 1 month ago

PR open here #2755