Sha256: 5cbca0a8ce42f32c26f56ee1eed2fc42eae411e164c2abd93da987bad657bac6

Contents?: true

Size: 510 Bytes

Versions: 11

Compression:

Stored size: 510 Bytes

Contents

# frozen_string_literal: true

module HTTPX
  module Plugins
    #
    # This plugin adds a shim +authentication+ method to the session, which will fill
    # the HTTP Authorization header.
    #
    # https://gitlab.com/honeyryderchuck/httpx/wikis/Authentication#authentication
    #
    module Authentication
      module InstanceMethods
        def authentication(token)
          headers("authorization" => token)
        end
      end
    end
    register_plugin :authentication, Authentication
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
httpx-0.6.7 lib/httpx/plugins/authentication.rb
httpx-0.6.6 lib/httpx/plugins/authentication.rb
httpx-0.6.5 lib/httpx/plugins/authentication.rb
httpx-0.6.4 lib/httpx/plugins/authentication.rb
httpx-0.6.3 lib/httpx/plugins/authentication.rb
httpx-0.6.2 lib/httpx/plugins/authentication.rb
httpx-0.6.1 lib/httpx/plugins/authentication.rb
httpx-0.6.0 lib/httpx/plugins/authentication.rb
httpx-0.5.1 lib/httpx/plugins/authentication.rb
httpx-0.5.0 lib/httpx/plugins/authentication.rb
httpx-0.4.1 lib/httpx/plugins/authentication.rb