Method: HTTParty::ClassMethods#basic_auth

Defined in:
lib/httparty.rb

#basic_auth(u, p) ⇒ Object

Allows setting basic authentication username and password.

class Foo
  include HTTParty
  basic_auth 'username', 'password'
end


123
124
125
# File 'lib/httparty.rb', line 123

def basic_auth(u, p)
  default_options[:basic_auth] = {username: u, password: p}
end