How do I do basic authentication with RestClient?

never_had_a_name picture never_had_a_name · Sep 11, 2010 · Viewed 44.4k times · Source

Does anyone know how to do basic authentication with RestClient?

I need to create a private repository on GitHub through their RESTful API.

Answer

opsb picture opsb · Nov 19, 2010

The easiest way is to embed the details in the URL:

RestClient.get "http://username:[email protected]"