We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Use the #basic_auth method to perform HTTP Basic Authentication using a username and password:
#basic_auth
HTTP.basic_auth(:user => "user", :pass => "pass") # <HTTP::Headers {"Authorization"=>"Basic dXNlcjpwYXNz"}>
You can pass a raw authorization header using the #auth method:
#auth
HTTP.auth("Bearer VGhlIEhUVFAgR2VtLCBST0NLUw") # <HTTP::Headers {"Authorization"=>"Bearer VGhlIEhUVFAgR2VtLCBST0NLUw"}>
Once you've added the desired authorization, make an HTTP request as usual:
HTTP.basic_auth(:user => "user", :pass => "pass") .get("https://example.com")