-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output errors reason when a request is failing with quiet option #1026
Comments
So something like |
@soullivaneuh You’re working on what looks like a scripted workflow. So you likely want to interrupt the flow if the request fails. For that, it’s better to rely on the exit status code than on the textual output. You can use if http --quiet --check-status httpbin.org/status/504 ; then
echo "OK"
else
echo "ERROR: $?"
exit 1
fi
# => ERROR: 5 To your question: When you apply |
HTTPie 2.4.0 with this change has just been released 🥧 |
Wow, just opened an issue from 10 days and I got a new release with clear indications about how to solve my need. Well done and thanks! I'll test this as soon as possible. |
I use HTTPie on a script to convert images:
It works, but when it fail I don't have any information because of the
--quiet
option:On that case, I have a Bad Gateway error (504).
If I remove it, I have the information but also when it success (200).
It would be great to have the possibility to quiet the output except if it's a request error.
The text was updated successfully, but these errors were encountered: