class Protocol::HTTP::Header::Authorization

~~~
headers.add(‘authorization’, Authorization.basic(“my_username”, “my_password”))
~~~ ruby
Used for basic authorization.

def self.basic(username, password)

def self.basic(username, password)
	strict_base64_encoded = ["#{username}:#{password}"].pack("m0")
	
	self.new(
		"Basic #{strict_base64_encoded}"
	)
end

def credentials

Returns:
  • (Tuple(String, String)) -
def credentials
	self.split(/\s+/, 2)
end