rails / thor

Thor is a toolkit for building powerful command-line interfaces.
http://whatisthor.com/
MIT License
5.12k stars 552 forks source link

Add support for providing http headers to get #801

Closed dnlgrv closed 1 year ago

dnlgrv commented 1 year ago

🌈

Sometimes we want to use get to make requests to an API or endpoint that requires certain headers to be present (such as auth).

OpenURI supports providing headers for the request, we just need to have a way of providing them.

This PR adds :http_headers as a config option to get, and is essentially just passed directly to URI.open.

Hopefully the test coverage and documentation is sufficient.

❤️💜💚💙💛