Open kidbrax opened 1 year ago
Hi, it seems reasonable. My only question: what should be the default behaviour of --json
? Do we include request and response body by default or to we add another flag (--json-full
etc...) to activate it...
Good question. When I first used it, I assumed the body would be included in the json by default. Seems unintuitive to include everything else and not the body. Thanks for the follow up!
for my two cents: i think it should be the default. it struck me as odd that using the --json
flag only provided metadata and not the result of the request unless i also added --very-verbose
, and then the response came through on stderr
instead of stdout
. i'd prefer it if including the response body was default behavior but also wish --json-full
existed and included all debug data included in the --very-verbose
output but as json.
now, I would also include it by default. We hadn't included initially mostly to be consistent with the HAR format.
See also this discussion
See also @iBicha comment => https://github.com/Orange-OpenSource/hurl/discussions/1969#discussioncomment-7418291
here a possible solution relating to JSON output and body:
--json
option as it is now (without body)--report-json
option similar to --report-html
that will keep all the responses in separate files without escaping. The JSON will simply includes the filename.write-out
option --json-full
option with all available data (body included in base64)--report-json
has been merged on master (5.0.0-SNAPSHOT): there is now a report.json
file referencing each HTTP responses of the run dumped to disk.
Problem to solve
I need a way to capture all the response bodies from a series of requests.
Proposal
I'd like to have the response bodies included in the --json output. This way I could filter down to exactly the output I want. Or just return all response bodies from the command instead of just the last one when not using json output.
Additional context and resources
As of now, I am using ver-verbose and redirecting stderr to a file which has all the responses. But hten I have to parse thorugh all the other info that I don't need.
Tasks to complete