Closed alex-y-kozlov closed 3 years ago
Yes ... I also want to work on this problem. I just opened #30 some time ago ... I have to decide how to implement it: curl style, httpie or follow rfc2616. I hope to work on this problem soon
httpie seems to be a good fit. in your syntax http is implicit and everything else follows the url
I didn't have much time and I need to works with http request with auth token too. I chose to run the programs present in the system path and let the user use his favorite tool.
jq '.'
$ http http://httpbin.org/get "Authorization: Bearer 1234abcd"
jq '.'
$ curl -X GET http://httpbin.org/get -H "Authorization: Bearer 1234abcd"
jq '.'
$ wget -qO- http://httpbin.org/get --header "Authorization: Bearer 1234abcd"
# It could be used with others tools
jq --raw-input '.'
$ cat /etc/issue
It's not bad as starting point. There are some caveats but as first working solution... is only few lines of code. I test a little bit then will release it
I released an experimental version with support of command line.
Most of APIs returning JSON are protected with API token that's passed via custom HTTP header. Being able to specify these headers curl-style (-H or similar) would make much more useful current ability to specify URL of hte JSON