hurl icon indicating copy to clipboard operation
hurl copied to clipboard

verbose mode did not print all the body text of requests

Open kaala opened this issue 1 year ago • 2 comments

What is the current bug behavior?

I have a hurl file with 3 requests, and I use --verbose command line options. I expect I can see all the response body for the 3 requests, but verbose mode only prints the response body byte size, and only the last one print the body text.

Steps to reproduce

prepare a hurl file with many requests in it, and run the file use hurl --verbose file.hurl

What is the expected correct behavior?

I expect all requests output the response body text.

Execution context

  • Hurl Version (hurl --version): hurl 4.3.0 (Windows) libcurl/8.4.0-DEV Schannel zlib/1.3 nghttp2/1.58.0 Features (libcurl): alt-svc AsynchDNS HSTS HTTP2 IPv6 Largefile libz NTLM SPNEGO SSL SSPI Unicode UnixSockets Features (built-in): brotli

Possible fixes

image

kaala avatar Apr 30 '24 13:04 kaala

Hi @kaala

This is the intended design of --verbose option. You can use --very-verbose to see all response bodies on standard error.

Wether you use or not --verbose/--very-verbose, the last response body is printed on standard output (once again by design).

jcamiel avatar Apr 30 '24 13:04 jcamiel

ok, then. could you tell me more about the reason behind this design?

kaala avatar May 03 '24 09:05 kaala

Sure, the idea is to be able to chain request to get data. The typical use case is getting data behind a login:

POST http://foo.com/login
[FormParams]
username: bob
password: secret
HTTP 302

GET http://foo.com/protected
HTTP 200

One logged, you get the response of the protected resources.

If you want intermediary resources, you can use an [Options] section :

GET https://foo.com
[Options]
# Save the response to an intermediary file
output: foo.bin

GET https://bar.com
[Options]
# Display response to standard output
output: -

Or you can write a request by file and then you will get all responses on standard output.

$ hurl foo.hurl bar.hurl baz.hurl

If you want to just test some requests and are not interested with the response, you can use --test:

$ hurl --test *.hurl

I'm closing the issue, feel free to open a discussion or proposed an issue for any new feature!

jcamiel avatar May 04 '24 13:05 jcamiel