Module: HTTParty

Included in:
Basement
Defined in:
lib/httparty.rb,
lib/httparty/request.rb,
lib/httparty/version.rb,
lib/httparty/exceptions.rb

Defined Under Namespace

Modules: ClassMethods Classes: Basement, RedirectionTooDeep, Request, UnsupportedFormat

Constant Summary collapse

AllowedFormats =
{:xml => 'text/xml', :json => 'application/json', :html => 'text/html'}
Version =
'0.2.3'

Class Method Summary collapse

Class Method Details

.delete(*args) ⇒ Object



106
107
108
# File 'lib/httparty.rb', line 106

def self.delete(*args)
  Basement.delete(*args)
end

.get(*args) ⇒ Object



94
95
96
# File 'lib/httparty.rb', line 94

def self.get(*args)
  Basement.get(*args)
end

.included(base) ⇒ Object



15
16
17
18
19
20
# File 'lib/httparty.rb', line 15

def self.included(base)
  base.extend ClassMethods
  base.send :include, ModuleLevelInheritableAttributes
  base.send(:mattr_inheritable, :default_options)
  base.instance_variable_set("@default_options", {})
end

.normalize_base_uri(url) ⇒ Object

:nodoc:



80
81
82
83
84
85
86
87
88
# File 'lib/httparty.rb', line 80

def self.normalize_base_uri(url) #:nodoc:
  use_ssl = (url =~ /^https/) || url.include?(':443')
  ends_with_slash = url =~ /\/$/
  
  url.chop! if ends_with_slash
  url.gsub!(/^https?:\/\//i, '')
  
  "http#{'s' if use_ssl}://#{url}"
end

.post(*args) ⇒ Object



98
99
100
# File 'lib/httparty.rb', line 98

def self.post(*args)
  Basement.post(*args)
end

.put(*args) ⇒ Object



102
103
104
# File 'lib/httparty.rb', line 102

def self.put(*args)
  Basement.put(*args)
end