Sha256: bd67b55a3b54705a319784fdb0d4882fb749ff5d7a53f5dec32542c1161c88c7

Contents?: true

Size: 729 Bytes

Versions: 18

Compression:

Stored size: 729 Bytes

Contents

module ExvoAuth::Autonomous::Http
  def get(*args)
    http.get(*args)
  end

  def post(*args)
    http.post(*args)
  end

  def put(path, options = {})
    # This fixes 411 responses from nginx (on heroku) 
    # when Content-Length is missing on put requests.
    options[:body] ||= ""
    http.put(path, options)
  end

  def delete(*args)
    http.delete(*args)
  end

  def head(*args)
    http.head(*args)
  end

  def options(*args)
    http.options(*args)
  end
  
  protected
  
  def http
    basement.base_uri(base_uri)
    basement.basic_auth(username, password)
    basement
  end
  
  def basement
    @basement ||= Class.new do
      include HTTParty
      debug_output if ExvoAuth::Config.debug
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
exvo-auth-0.14.1 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.14.0 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.13.0 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.12.2 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.12.1 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.12.0 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.11.2 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.11.1 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.11.0 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.10.4 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.10.3 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.10.2 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.10.1 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.10.0 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.9.10 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.9.9 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.9.8 lib/exvo_auth/autonomous/http.rb
exvo-auth-0.9.7 lib/exvo_auth/autonomous/http.rb