hurl icon indicating copy to clipboard operation
hurl copied to clipboard

Add option to print response bodies for each entry in file

Open asmodeus812 opened this issue 1 year ago • 3 comments

Problem to solve

I would like to be able to print the response for each entry in a file, as of now even using --verbose, it does print only the last response, the entries' headers are there for each of them, if we do --verbose --include but i can only see the response of the last entry whichever it happens to be in the file or if selected with --from / --to entry options.

Proposal

I think this should be a separate option, not related to verbose, which should allow us to print the response for each entry, just as it works for a single one. And it should work with other flags such as --include, meaning that we can then see all response headers and bodies for each entry in the file, or range of entries that have been run.

asmodeus812 avatar Jun 10 '24 06:06 asmodeus812

See #1808 and https://github.com/Orange-OpenSource/hurl/issues/1808#issuecomment-1662542800

Hi @asmodeus812

Thanks for the issue. As a workaround, you can output a particular response on standard ouput using --output

GET https://foo.com
HTTP 200

# This response will be dumped 
# -  is for standard output
GET https://bar.com
[Options]
output: - 
HTTP 200

GET https://baz.com
HTTP 200

jcamiel avatar Jun 10 '24 07:06 jcamiel

See #1808 and #1808 (comment) 参见 #1808 和 #1808 (comment)

Hi  嗨@asmodeus812

Thanks for the issue. As a workaround, you can output a particular response on standard ouput using --output谢谢你的问题。作为一种变通方法,您可以使用 --output 在标准输出上输出特定的响应

GET https://foo.com
HTTP 200

# This response will be dumped 
# -  is for standard output
GET https://bar.com
[Options]
output: - 
HTTP 200

GET https://baz.com
HTTP 200

when i use output: - , No line breaks between two outputs, Is there any way to add a line break between two pieces of output?

R0boter avatar Jun 26 '24 07:06 R0boter

Hi @R0boter unfortunately no, for the moment.

jcamiel avatar Jun 26 '24 11:06 jcamiel