Sha256: efb161d215e2b27acca5423ed7170fccdc507f0cf7e3ed5f0bf5899d0f9daf8e

Contents?: true

Size: 520 Bytes

Versions: 55

Compression:

Stored size: 520 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)
          with(headers: { "authorization" => token })
        end
      end
    end
    register_plugin :authentication, Authentication
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
httpx-0.21.1 lib/httpx/plugins/authentication.rb
httpx-0.21.0 lib/httpx/plugins/authentication.rb
httpx-0.20.5 lib/httpx/plugins/authentication.rb
httpx-0.20.4 lib/httpx/plugins/authentication.rb
httpx-0.20.3 lib/httpx/plugins/authentication.rb
httpx-0.20.2 lib/httpx/plugins/authentication.rb
httpx-0.20.1 lib/httpx/plugins/authentication.rb
httpx-0.20.0 lib/httpx/plugins/authentication.rb
httpx-0.19.8 lib/httpx/plugins/authentication.rb
httpx-0.19.7 lib/httpx/plugins/authentication.rb
httpx-0.19.6 lib/httpx/plugins/authentication.rb
httpx-0.19.5 lib/httpx/plugins/authentication.rb
httpx-0.19.4 lib/httpx/plugins/authentication.rb
httpx-0.19.3 lib/httpx/plugins/authentication.rb
httpx-0.19.2 lib/httpx/plugins/authentication.rb
httpx-0.19.1 lib/httpx/plugins/authentication.rb
httpx-0.19.0 lib/httpx/plugins/authentication.rb
httpx-0.18.7 lib/httpx/plugins/authentication.rb
httpx-0.18.6 lib/httpx/plugins/authentication.rb
httpx-0.18.5 lib/httpx/plugins/authentication.rb