usebruno / bruno

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

Cookies in CLI #2821

Open matthewdickinson opened 1 month ago

matthewdickinson commented 1 month ago

I have checked the following:

Describe the feature you want to add

Currently, as far as I've seen, there is no support for cookies when running requests from the CLI. This is unfortunate since I have a use-case to run a folder of requests via CLI as part of a test suite. The first request in the folder would log in via an authentication mechanism that results in a cookie being set, and this cookie would be passed on in subsequent requests. However, short of writing unnecessarily complex pre and post request scripts, this is currently not feasible.

I would like Bruno CLI to support cookies for a single invocation of bru. For backwards, compatibility, I would think this would be an additional flag that defaulted to false.

Attached is my PR to add this feature.

Mockups or Images of the feature

I think the call would look like this:

bru run --env Local --use-cookies
alan-suchanek commented 4 days ago

+1 I have the same use case. Without support for cookies, I can't use Bruno effectively in test suites.