You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think curl's --include output headers on stdout.
For instance:
$ curl http://localhost:8000/hello
Hello World!%
$ curl --include http://localhost:8000/hello
HTTP/1.1 200 OK
Server: Werkzeug/3.0.6 Python/3.12.4
Date: Wed, 20 Nov 2024 13:56:41 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 12
Server: Flask Server
Connection: close
Hello World!%
$ curl --include --output /dev/null http://localhost:8000/hello
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12 100 12 0 0 5842 0 --:--:-- --:--:-- --:--:-- 6000
So when curl uses --include and --output /dev/null, it doesn't display headers.
Given this, we want Hurl to work as curl so it makes sense that echo 'GET http://localhost:8000/hello' | hurl --include --output /dev/null is displaying nothing.
Now, you may want to display only headers. A potential solution will be (as mentionned in #1745) to implement --dump-header or --write-out:
$ curl --dump-header - --silent --output /dev/null http://localhost:8000/hello
HTTP/1.1 200 OK
Server: Werkzeug/3.0.6 Python/3.12.4
Date: Wed, 20 Nov 2024 14:04:30 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 12
Server: Flask Server
Connection: close
What is the current bug behavior?
Running
echo 'GET https://www.wikipedia.org' | hurl --include --no-output
shows nothing on stdout, yet headers should be displayed.What is the expected correct behavior?
Body should not be printed, but headers should.
Execution context
hurl --version
):Possible fixes
A workaround exists for the http method
GET
: useHEAD
instead.However, this does not work with
PUT
orPOST
for example.There should be a way to only display the response headers without the body.
Perhaps a new option
--no-body
could be introduced.Note: the manual entry for
--no-output
seems partially misleading, and talks about the body:The text was updated successfully, but these errors were encountered: