talis-fb / TReq

A CLI tool for effortless HTTP requests
GNU General Public License v3.0
55 stars 2 forks source link

Add `--offline` flag to construct requests and print them in stdout without sending them #22

Open talis-fb opened 8 months ago

talis-fb commented 8 months ago

The objective is to replicate this feature in HTTPie (https://httpie.io/docs/cli/offline-mode). This will be applied in Basic request subcommand (like treq GET or treq POST) and treq run. When the --offline flag is used, instead build the request and submit it, the app should return the raw request would be made. This is useful when users want to check if the request he is gonna submit is right.

Additional Considerations:

It's necessary add a field in CliInput. Like "request_items" field another field called "request_options". The field should be passed to ViewCommandExecutor of Submit Request. There, should live a switch. It get and build request, and instead submit it, just prints it. Create a Executor just to this new behavior.