2 ms·
You may consider giving httpie cli a test drive, if you are dealing with json endpoints. You can put in Bearer header and JSON arguments quite easily with
by _flux 3y ago
You may consider giving httpie cli a test drive, if you are dealing with json endpoints. You can put in Bearer header and JSON arguments quite easily with
http localhost:1234/end/point Authorization:$bearertoken arg1=hello arg2:='{"a":42}'
and get colorized JSON out from it. I use my script called Authorization to fish out the bearer token so in my case the call is just
http .. "`Authorization`" ..
So while one can achieve the same with some jq+curl, it perhaps is a bit more prepackaged in httpie.