Module: HTTParty

Extended by:
AllowedFormatsDeprecation
Included in:
Basement
Defined in:
lib/httparty.rb,
lib/httparty/parser.rb,
lib/httparty/request.rb,
lib/httparty/response.rb,
lib/httparty/exceptions.rb,
lib/httparty/core_extensions.rb,
lib/httparty/module_inheritable_attributes.rb

Defined Under Namespace

Modules: AllowedFormatsDeprecation, ClassMethods, ModuleInheritableAttributes Classes: Basement, BasicObject, CookieHash, Parser, RedirectionTooDeep, Request, Response, ResponseError, UnsupportedFormat, UnsupportedURIScheme

Constant Summary collapse

VERSION =
"0.6.1".freeze
CRACK_DEPENDENCY =
"0.1.8".freeze

Class Method Summary collapse

Methods included from AllowedFormatsDeprecation

const_missing

Class Method Details

.delete(*args) ⇒ Object



343
344
345
# File 'lib/httparty.rb', line 343

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

.get(*args) ⇒ Object



331
332
333
# File 'lib/httparty.rb', line 331

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

.head(*args) ⇒ Object



347
348
349
# File 'lib/httparty.rb', line 347

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

.included(base) ⇒ Object



31
32
33
34
35
36
37
38
# File 'lib/httparty.rb', line 31

def self.included(base)
  base.extend ClassMethods
  base.send :include, HTTParty::ModuleInheritableAttributes
  base.send(:mattr_inheritable, :default_options)
  base.send(:mattr_inheritable, :default_cookies)
  base.instance_variable_set("@default_options", {})
  base.instance_variable_set("@default_cookies", CookieHash.new)
end

.normalize_base_uri(url) ⇒ Object

:nodoc:



316
317
318
319
320
321
322
323
324
325
# File 'lib/httparty.rb', line 316

def self.normalize_base_uri(url) #:nodoc:
  normalized_url = url.dup
  use_ssl = (normalized_url =~ /^https/) || normalized_url.include?(':443')
  ends_with_slash = normalized_url =~ /\/$/

  normalized_url.chop! if ends_with_slash
  normalized_url.gsub!(/^https?:\/\//i, '')

  "http#{'s' if use_ssl}://#{normalized_url}"
end

.options(*args) ⇒ Object



351
352
353
# File 'lib/httparty.rb', line 351

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

.post(*args) ⇒ Object



335
336
337
# File 'lib/httparty.rb', line 335

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

.put(*args) ⇒ Object



339
340
341
# File 'lib/httparty.rb', line 339

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