Sha256: bccb93a0aab8d8cc8657e19f6d4e445df85aa377b1ca231962622698360d413d

Contents?: true

Size: 509 Bytes

Versions: 13

Compression:

Stored size: 509 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/os85/httpx/wikis/Authentication#authentication
    #
    module Authentication
      module InstanceMethods
        def authentication(token)
          with(headers: { "authorization" => token })
        end
      end
    end
    register_plugin :authentication, Authentication
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
httpx-0.24.1 lib/httpx/plugins/authentication.rb
httpx-0.24.0 lib/httpx/plugins/authentication.rb
httpx-0.23.4 lib/httpx/plugins/authentication.rb
httpx-0.23.3 lib/httpx/plugins/authentication.rb
httpx-0.23.2 lib/httpx/plugins/authentication.rb
httpx-0.23.1 lib/httpx/plugins/authentication.rb
httpx-0.23.0 lib/httpx/plugins/authentication.rb
httpx-0.22.5 lib/httpx/plugins/authentication.rb
httpx-0.22.4 lib/httpx/plugins/authentication.rb
httpx-0.22.3 lib/httpx/plugins/authentication.rb
httpx-0.22.2 lib/httpx/plugins/authentication.rb
httpx-0.22.1 lib/httpx/plugins/authentication.rb
httpx-0.22.0 lib/httpx/plugins/authentication.rb