Skip to content
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

curl -f verbose feature request #687

Closed
melezhik opened this issue Feb 29, 2016 · 4 comments
Closed

curl -f verbose feature request #687

melezhik opened this issue Feb 29, 2016 · 4 comments

Comments

@melezhik
Copy link

Hi!

I need to see http body when htp request fails. curl -f does it job fine providing http status validation, but it suppress http body.

If any way to improve this somehow?

And yes, I need an actual exit code as curl -f does.

Thanks in advance

Alexey

@bagder
Copy link
Member

bagder commented Feb 29, 2016

-f implies you don't care about the body. If you still want the body. a work-around can be made with -w instead.

I'll be willing to discuss details on the curl-users mailing list, feature requests aren't really suitable in an issue tracker.

@bagder bagder closed this as completed Feb 29, 2016
@melezhik
Copy link
Author

Ok, I know how curl -f acts, and I know how curl -w acts as well. But boths cases ars not good, easy to use for me.

I need behavior like with curl -f , meaning correct exit code and in case I handle this - immediate break of my script. But I still need a body. Many modern rest API, web applicatios return vital information via body when return none successful http code. curl -s -o /dev/null -w "%{http_code}\n" is possible workaround but it still requires additional bash code to verify http status which is neither convenient nor good code style , I try to avoid such bashisms which eventually make code hard to maintain.

Ok, let's consider this like future request , I need a curl -f behavior plus http body at output, you don't have to change current inplimentation, we may talk about additional flag , something like --with-body or whatever proper for you. Is this a big deal ? Most part of job is done, I mean curl -f implementation already here , some extra prices is left, but thus would make curl more helpful 😄

@melezhik
Copy link
Author

Let me know where I could repost it to suggestion, curl user mail list ?

@jay
Copy link
Member

jay commented Feb 29, 2016

Yup, subscribe here.

@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants