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.13.1 lib/httpx/plugins/authentication.rb
httpx-0.13.0 lib/httpx/plugins/authentication.rb
httpx-0.12.0 lib/httpx/plugins/authentication.rb
httpx-0.11.3 lib/httpx/plugins/authentication.rb
httpx-0.11.2 lib/httpx/plugins/authentication.rb
httpx-0.11.1 lib/httpx/plugins/authentication.rb
httpx-0.11.0 lib/httpx/plugins/authentication.rb
httpx-0.10.2 lib/httpx/plugins/authentication.rb
httpx-0.10.1 lib/httpx/plugins/authentication.rb
httpx-0.10.0 lib/httpx/plugins/authentication.rb
httpx-0.9.0 lib/httpx/plugins/authentication.rb
httpx-0.8.2 lib/httpx/plugins/authentication.rb
httpx-0.8.1 lib/httpx/plugins/authentication.rb
httpx-0.8.0 lib/httpx/plugins/authentication.rb
httpx-0.7.0 lib/httpx/plugins/authentication.rb