6 ms·
After this change the equivalent would be: curl -XPOST --jp username=YOUR.USERNAME password=YOUR.PASSWORD https://api.ctl.io/v2/authentication/login Which
by parhamn 5y ago
After this change the equivalent would be:
curl -XPOST --jp username=YOUR.USERNAME password=YOUR.PASSWORD https://api.ctl.io/v2/authentication/login
Which isn't too far from your desired outcome (notably, without relying on argument position for meaning). Although, I guess the argument that "curl is already installed on almost every server", sorta gets moot because I imagine it will take a while for most distros to move to the latest curl that will support --json/--jp
- jedberg 5y agoIt's a lot easier for a distro to update a default utility than to add a new one though. I suspect having updated curl would happen faster than adding httpie to the list of default utilities.
- derefr 5y agoEspecially singe HTTPie is a python package. curl exists even in plenty of embedded systems, in many Docker base-images, etc.; but scripting runtimes like Python generally don't.
- thwarted 5y agoThe exact opposite is more likely true, depending on the nature of the change. A new utility has no current usage so there are no in-the-wild backwards compatibility concerns. The system python on redhat based distros was stuck at 2 for a long time because some of the sysadmin utilities relied on it and all those deps needs to be vetted or converted to either a newer python version or their own shipped version of the runtime that didn't use the general purpose python install.
- _ea1k 5y agoThere's a big difference between a bump to the latest curl version and a jump between two major versions of a language runtime. The Python 2->3 transition took years and many distros kept both versions. Most dependencies get updated much more quickly. It wouldn't even shock me if this change got picked up mid-cycle.
- bonkabonka 5y agoUnhappily RedHat won't. Heck, RedHat has gone well out of their way to backport updated TLS handshakes (1.2 at least) to their 2013 version (7.29.0) of curl.
- _ea1k 5y agoI'm assuming that you mean for RHEL? That's a little bit of a special case.
- jedberg 5y agoPython is a huge outlier in this case. Very rarely do you have a default tool that can't be upgraded, and this case was only because Python is an interpreted language. Curl is a command line tool. As long as they only add new functionality, there is very little that prevents an upgrade.
- ericbarrett 5y agoThis is only a valid comparison if curl deprecates or moves options, as Python 3 did with language features and standard library functions.
- bonkabonka 5y agoExcept if it's an enterprisey distro, it won't get updated. Specifically RHEL 7 ships 7.29.0 and cherry-picks features (TLS handshakes) to backport to their nine-year-old version.
- sneak 5y agoI wish this were the case. Unfortunately for us grownups that run stable/LTS distros, non-security updates like these don't usually make it to us for like 5 years or something. There's a happy medium, and we're not in it.
- fragmede 5y agoIt depends. How long did to take for bash4-isms to get adopted? Sometimes the update time for more basic utilities, for all systems can take a long time. (Apple switching to zsh doesn't help here.)
- floatingatoll 5y agonit for understanding's sake: is the second --jp missing?
- parhamn 5y agoNot per the linked wiki [1]. But it is still being designed it seems. [1] https://github.com/curl/curl/wiki/JSON#--jp-part https://github.com/curl/curl/wiki/JSON#--jp-part
- jlundberg 5y agoAnd that -X POST is actually not needed. Adding any payload will make curl do a POST request.
- mback2k 5y agoAlso see: https://daniel.haxx.se/blog/2015/09/11/unnecessary-use-of-curl-x/ https://daniel.haxx.se/blog/2015/09/11/unnecessary-use-of-cu...